Skip to content

Commit

Permalink
[JS] Fix summary evaluator result logging (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Aug 27, 2024
1 parent c1de373 commit 34408f6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "langsmith",
"version": "0.1.47",
"version": "0.1.48",
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
"packageManager": "[email protected]",
"files": [
Expand Down
5 changes: 3 additions & 2 deletions js/src/evaluation/_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,12 @@ export class _ExperimentManager {
this.client._selectEvalResults(summaryEvalResult);
aggregateFeedback.push(...flattenedResults);
for (const result of flattenedResults) {
const { targetRunId, ...feedback } = result;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { targetRunId, key, ...feedback } = result;
const evaluatorInfo = feedback.evaluatorInfo;
delete feedback.evaluatorInfo;

await this.client.createFeedback(null, "key", {
await this.client.createFeedback(null, key, {
...feedback,
projectId: projectId,
sourceInfo: evaluatorInfo,
Expand Down
2 changes: 1 addition & 1 deletion js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export type {
export { RunTree, type RunTreeConfig } from "./run_trees.js";

// Update using yarn bump-version
export const __version__ = "0.1.47";
export const __version__ = "0.1.48";
4 changes: 2 additions & 2 deletions js/src/tests/evaluate.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ test("evaluate can evaluate with summary evaluators", async () => {
const runIds = runs.map(({ id }) => id).join(", ");
const exampleIds = examples?.map(({ id }) => id).join(", ");
return Promise.resolve({
key: "key",
key: "MyCustomScore",
score: 1,
comment: `Runs: ${runIds} Examples: ${exampleIds}`,
});
Expand All @@ -279,7 +279,7 @@ test("evaluate can evaluate with summary evaluators", async () => {
});

expect(evalRes.summaryResults.results).toHaveLength(1);
expect(evalRes.summaryResults.results[0].key).toBe("key");
expect(evalRes.summaryResults.results[0].key).toBe("MyCustomScore");
expect(evalRes.summaryResults.results[0].score).toBe(1);
const allRuns = evalRes.results.map(({ run }) => run);
const allExamples = evalRes.results.map(({ example }) => example);
Expand Down

0 comments on commit 34408f6

Please sign in to comment.