Merge branch 'vwp/upgrade_sdk' into vwp/eval_chains

This commit is contained in:
vowelparrot
2023-06-12 23:53:03 -07:00
3 changed files with 15 additions and 3 deletions
@@ -1,5 +1,5 @@
import { LangChainPlusClient } from "langchainplus-sdk";
import { Run, RunCreate, RunUpdate } from "langchainplus-sdk/schemas";
import { BaseRun, RunCreate, RunUpdate } from "langchainplus-sdk/schemas";
import {
getEnvironmentVariable,
getRuntimeEnvironment,
@@ -7,6 +7,12 @@ import {
import { BaseTracer } from "./tracer.js";
import { BaseCallbackHandlerInput } from "../base.js";
export interface Run extends BaseRun {
id: string;
child_runs: this[];
child_execution_order: number;
}
export interface LangChainTracerFields extends BaseCallbackHandlerInput {
exampleId?: string;
sessionName?: string;
@@ -65,6 +65,13 @@ export class ChoicesOutputParser extends RunEvaluatorOutputParser {
// A map from multiple choice strings to scores
choicesMap?: Record<string, number>;
lc_namespace: string[] = [
"langchain",
"evaluation",
"run_evaluators",
"implementations",
];
constructor({
evaluationName,
choicesMap,
@@ -12,15 +12,14 @@ import { RunEvaluatorChain } from "../base.js";
const testRun: Run = {
inputs: new Map([["query", "How much wood could a woodchuck chuck?"]]),
outputs: new Map([["myPrediction", "42. no more, no less."]]),
child_runs: [],
execution_order: 1,
name: "Test Run",
id: "1",
child_execution_order: 1,
end_time: 1,
start_time: 0,
run_type: "llm",
serialized: {},
session_id: "1",
};
const testExample: Example = {