langchain 0.1.31 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -90,12 +90,7 @@ class SelfQueryRetriever extends retrievers_1.BaseRetriever {
|
|
|
90
90
|
if (!this.useOriginalQuery && generatedQuery && generatedQuery.length > 0) {
|
|
91
91
|
myQuery = generatedQuery;
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
return [];
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
return this.vectorStore.similaritySearch(myQuery, this.searchParams?.k, filter, runManager?.getChild("vectorstore"));
|
|
98
|
-
}
|
|
93
|
+
return this.vectorStore.similaritySearch(myQuery, this.searchParams?.k, filter, runManager?.getChild("vectorstore"));
|
|
99
94
|
}
|
|
100
95
|
/**
|
|
101
96
|
* Static method to create a new SelfQueryRetriever instance from a
|
|
@@ -85,12 +85,7 @@ export class SelfQueryRetriever extends BaseRetriever {
|
|
|
85
85
|
if (!this.useOriginalQuery && generatedQuery && generatedQuery.length > 0) {
|
|
86
86
|
myQuery = generatedQuery;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
return [];
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
return this.vectorStore.similaritySearch(myQuery, this.searchParams?.k, filter, runManager?.getChild("vectorstore"));
|
|
93
|
-
}
|
|
88
|
+
return this.vectorStore.similaritySearch(myQuery, this.searchParams?.k, filter, runManager?.getChild("vectorstore"));
|
|
94
89
|
}
|
|
95
90
|
/**
|
|
96
91
|
* Static method to create a new SelfQueryRetriever instance from a
|
|
@@ -414,7 +414,7 @@ const applyEvaluators = async ({ evaluation, runs, examples, client, }) => {
|
|
|
414
414
|
for (let i = 0; i < runs.length; i += 1) {
|
|
415
415
|
const run = runs[i];
|
|
416
416
|
const example = examples[i];
|
|
417
|
-
const evaluatorResults = await Promise.
|
|
417
|
+
const evaluatorResults = await Promise.allSettled(evaluators.map((evaluator) => client.evaluateRun(run, evaluator, {
|
|
418
418
|
referenceExample: example,
|
|
419
419
|
loadChildRuns: false,
|
|
420
420
|
})));
|
|
@@ -423,7 +423,7 @@ const applyEvaluators = async ({ evaluation, runs, examples, client, }) => {
|
|
|
423
423
|
execution_time: run?.end_time && run.start_time
|
|
424
424
|
? run.end_time - run.start_time
|
|
425
425
|
: undefined,
|
|
426
|
-
feedback: evaluatorResults,
|
|
426
|
+
feedback: evaluatorResults.map((evalResult) => evalResult.status === "fulfilled" ? evalResult.value : evalResult.reason),
|
|
427
427
|
run_id: run.id,
|
|
428
428
|
};
|
|
429
429
|
}
|
|
@@ -411,7 +411,7 @@ const applyEvaluators = async ({ evaluation, runs, examples, client, }) => {
|
|
|
411
411
|
for (let i = 0; i < runs.length; i += 1) {
|
|
412
412
|
const run = runs[i];
|
|
413
413
|
const example = examples[i];
|
|
414
|
-
const evaluatorResults = await Promise.
|
|
414
|
+
const evaluatorResults = await Promise.allSettled(evaluators.map((evaluator) => client.evaluateRun(run, evaluator, {
|
|
415
415
|
referenceExample: example,
|
|
416
416
|
loadChildRuns: false,
|
|
417
417
|
})));
|
|
@@ -420,7 +420,7 @@ const applyEvaluators = async ({ evaluation, runs, examples, client, }) => {
|
|
|
420
420
|
execution_time: run?.end_time && run.start_time
|
|
421
421
|
? run.end_time - run.start_time
|
|
422
422
|
: undefined,
|
|
423
|
-
feedback: evaluatorResults,
|
|
423
|
+
feedback: evaluatorResults.map((evalResult) => evalResult.status === "fulfilled" ? evalResult.value : evalResult.reason),
|
|
424
424
|
run_id: run.id,
|
|
425
425
|
};
|
|
426
426
|
}
|