langsmith
Advanced tools
Comparing version 0.3.10 to 0.3.11-rc.0
@@ -682,7 +682,7 @@ import { AsyncCallerParams } from "./utils/async_caller.js"; | ||
listPresignedFeedbackTokens(runId: string): AsyncIterable<FeedbackIngestToken>; | ||
_selectEvalResults(results: EvaluationResult | EvaluationResults): Array<EvaluationResult>; | ||
_logEvaluationFeedback(evaluatorResponse: EvaluationResult | EvaluationResults, run?: Run, sourceInfo?: { | ||
_selectEvalResults(results: EvaluationResult | EvaluationResult[] | EvaluationResults): Array<EvaluationResult>; | ||
_logEvaluationFeedback(evaluatorResponse: EvaluationResult | EvaluationResult[] | EvaluationResults, run?: Run, sourceInfo?: { | ||
[key: string]: any; | ||
}): Promise<[results: EvaluationResult[], feedbacks: Feedback[]]>; | ||
logEvaluationFeedback(evaluatorResponse: EvaluationResult | EvaluationResults, run?: Run, sourceInfo?: { | ||
logEvaluationFeedback(evaluatorResponse: EvaluationResult | EvaluationResult[] | EvaluationResults, run?: Run, sourceInfo?: { | ||
[key: string]: any; | ||
@@ -689,0 +689,0 @@ }): Promise<EvaluationResult[]>; |
@@ -18,5 +18,5 @@ import { Client } from "../index.js"; | ||
/** @deprecated Use object parameter version instead: (args: { runs, examples, inputs, outputs, referenceOutputs }) => ... */ | ||
type DeprecatedSyncSummaryEvaluator = (runs: Array<Run>, examples: Array<Example>) => EvaluationResult | EvaluationResults; | ||
type DeprecatedSyncSummaryEvaluator = (runs: Array<Run>, examples: Array<Example>) => EvaluationResult | EvaluationResult[] | EvaluationResults; | ||
/** @deprecated Use object parameter version instead: (args: { runs, examples, inputs, outputs, referenceOutputs }) => ... */ | ||
type DeprecatedAsyncSummaryEvaluator = (runs: Array<Run>, examples: Array<Example>) => Promise<EvaluationResult | EvaluationResults>; | ||
type DeprecatedAsyncSummaryEvaluator = (runs: Array<Run>, examples: Array<Example>) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>; | ||
export type SummaryEvaluatorT = DeprecatedSyncSummaryEvaluator | DeprecatedAsyncSummaryEvaluator | ((args: { | ||
@@ -28,3 +28,3 @@ runs: Array<Run>; | ||
referenceOutputs?: Array<Record<string, any>>; | ||
}) => EvaluationResult | EvaluationResults) | ((args: { | ||
}) => EvaluationResult | EvaluationResult[] | EvaluationResults) | ((args: { | ||
runs: Array<Run>; | ||
@@ -35,9 +35,9 @@ examples: Array<Example>; | ||
referenceOutputs?: Array<Record<string, any>>; | ||
}) => Promise<EvaluationResult | EvaluationResults>); | ||
}) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>); | ||
/** @deprecated Use object parameter version instead: (args: { run, example, inputs, outputs, referenceOutputs }) => ... */ | ||
type DeprecatedRunEvaluator = RunEvaluator; | ||
/** @deprecated Use object parameter version instead: (args: { run, example, inputs, outputs, referenceOutputs }) => ... */ | ||
type DeprecatedFunctionEvaluator = (run: Run, example?: Example) => EvaluationResult | EvaluationResults; | ||
type DeprecatedFunctionEvaluator = (run: Run, example?: Example) => EvaluationResult | EvaluationResult[] | EvaluationResults; | ||
/** @deprecated Use object parameter version instead: (args: { run, example, inputs, outputs, referenceOutputs }) => ... */ | ||
type DeprecatedAsyncFunctionEvaluator = (run: Run, example?: Example) => Promise<EvaluationResult | EvaluationResults>; | ||
type DeprecatedAsyncFunctionEvaluator = (run: Run, example?: Example) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>; | ||
export type EvaluatorT = DeprecatedRunEvaluator | DeprecatedFunctionEvaluator | DeprecatedAsyncFunctionEvaluator | ((args: { | ||
@@ -50,3 +50,3 @@ run: Run; | ||
attachments?: Record<string, any>; | ||
}) => EvaluationResult | EvaluationResults) | ((args: { | ||
}) => EvaluationResult | EvaluationResult[] | EvaluationResults) | ((args: { | ||
run: Run; | ||
@@ -58,3 +58,3 @@ example: Example; | ||
attachments?: Record<string, any>; | ||
}) => Promise<EvaluationResult | EvaluationResults>); | ||
}) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>); | ||
interface _ForwardResults { | ||
@@ -61,0 +61,0 @@ run: Run; |
@@ -75,3 +75,3 @@ import { Example, FeedbackConfig, Run, ScoreType, ValueType } from "../schemas.js"; | ||
} | ||
export type RunEvaluatorLike = ((run: Run, example?: Example) => Promise<EvaluationResult | EvaluationResults>) | ((run: Run, example?: Example) => EvaluationResult | EvaluationResults) | ((run: Run, example: Example) => Promise<EvaluationResult | EvaluationResults>) | ((run: Run, example: Example) => EvaluationResult | EvaluationResults) | ((args: { | ||
export type RunEvaluatorLike = ((run: Run, example?: Example) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>) | ((run: Run, example?: Example) => EvaluationResult | EvaluationResult[] | EvaluationResults) | ((run: Run, example: Example) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>) | ((run: Run, example: Example) => EvaluationResult | EvaluationResult[] | EvaluationResults) | ((args: { | ||
run: Run; | ||
@@ -82,3 +82,3 @@ example: Example; | ||
referenceOutputs?: Record<string, any>; | ||
}) => EvaluationResult | EvaluationResults) | ((args: { | ||
}) => EvaluationResult | EvaluationResult[] | EvaluationResults) | ((args: { | ||
run: Run; | ||
@@ -89,3 +89,3 @@ example: Example; | ||
referenceOutputs?: Record<string, any>; | ||
}) => Promise<EvaluationResult | EvaluationResults>); | ||
}) => Promise<EvaluationResult | EvaluationResult[] | EvaluationResults>); | ||
/** | ||
@@ -92,0 +92,0 @@ * Wraps an evaluator function + implements the RunEvaluator interface. |
@@ -82,7 +82,7 @@ import { v4 as uuidv4 } from "uuid"; | ||
}); | ||
const result = (await wrappedTraceableFunc( | ||
const result = await wrappedTraceableFunc( | ||
// Pass data via `langSmithRunAndExample` key to avoid conflicts with other | ||
// inputs. This key is extracted in the wrapped function, with `run` and | ||
// `example` passed to evaluator function as arguments. | ||
{ langSmithRunAndExample: { run, example } }, { metadata })); | ||
{ langSmithRunAndExample: { run, example } }, { metadata }); | ||
// Check the one required property of EvaluationResult since 'instanceof' is not possible | ||
@@ -95,2 +95,7 @@ if ("key" in result) { | ||
} | ||
if (Array.isArray(result)) { | ||
return { | ||
results: result.map((r) => this.coerceEvaluationResult(r, sourceRunId, false)), | ||
}; | ||
} | ||
if (typeof result !== "object") { | ||
@@ -97,0 +102,0 @@ throw new Error("Evaluator function must return an object."); |
@@ -5,2 +5,2 @@ export { Client, type ClientConfig, type LangSmithTracingClientInterface, } from "./client.js"; | ||
export { overrideFetchImplementation } from "./singletons/fetch.js"; | ||
export declare const __version__ = "0.3.10"; | ||
export declare const __version__ = "0.3.11-rc.0"; |
@@ -5,2 +5,2 @@ export { Client, } from "./client.js"; | ||
// Update using yarn bump-version | ||
export const __version__ = "0.3.10"; | ||
export const __version__ = "0.3.11-rc.0"; |
{ | ||
"name": "langsmith", | ||
"version": "0.3.10", | ||
"version": "0.3.11-rc.0", | ||
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", | ||
@@ -5,0 +5,0 @@ "packageManager": "yarn@1.22.19", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1005851
25432