GraphReFlyTS

API Reference

scoreSubjects()

Scores subjects from explicit ScoreSignal facts and ranks the resulting view (D573).

Import

import { scoreSubjects } from "@graphrefly/ts/scoring";

Signature

function scoreSubjects(
	subjects: readonly ScoreSubject<T>[],
	signals: readonly ScoreSignal[],
	policy: ScorePolicy,
	opts: ScoreSubjectsOptions = {},
): ScoredView<T>

Parameters

ParameterTypeDescription
subjectsreadonly ScoreSubject<T>[]subjects value used by the helper.
signalsreadonly ScoreSignal[]signals value used by the helper.
policyScorePolicyPolicy object used to admit, retry, or route work.
optsScoreSubjectsOptionsOptions that configure the helper.

Returns

A ScoredView<T> value.

Example

import { scoreSubjects } from "@graphrefly/ts/scoring";

Source

packages/ts/src/scoring/helpers.ts