basic scoring function works

This commit is contained in:
Xi Yan 2024-10-23 14:42:28 -07:00
parent 38e31ab525
commit 70c08e694d
5 changed files with 164 additions and 6 deletions

View file

@ -217,4 +217,14 @@ class ScoringRouter(Scoring):
async def score(
self, input_rows: List[Dict[str, Any]], scoring_functions: List[str]
) -> ScoreResponse:
pass
# look up and map each scoring function to its provider impl
for fn_identifier in scoring_functions:
score_response = await self.routing_table.get_provider_impl(
fn_identifier
).score(
input_rows=input_rows,
scoring_functions=[fn_identifier],
)
print(
f"fn_identifier={fn_identifier}, score_response={score_response}",
)