-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Fix memory issue with empty model response (#11300)
- Loading branch information
1 parent
f98f0ea
commit 216b119
Showing
3 changed files
with
106 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,8 @@ | |
"[email protected]": "patches/[email protected]", | ||
"@types/[email protected]": "patches/@[email protected]", | ||
"@types/[email protected]": "patches/@[email protected]", | ||
"@types/[email protected]": "patches/@[email protected]" | ||
"@types/[email protected]": "patches/@[email protected]", | ||
"@langchain/[email protected]": "patches/@[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/dist/memory.cjs b/dist/memory.cjs | ||
index f5bceead9a5533ff71e0c6f6960384ced2ee0060..5085269a58493c29e36ea7384368cd64a0e979a5 100644 | ||
--- a/dist/memory.cjs | ||
+++ b/dist/memory.cjs | ||
@@ -41,7 +41,7 @@ exports.getInputValue = getInputValue; | ||
*/ | ||
const getOutputValue = (outputValues, outputKey) => { | ||
const value = getValue(outputValues, outputKey); | ||
- if (!value) { | ||
+ if (!value && value !== '') { | ||
const keys = Object.keys(outputValues); | ||
throw new Error(`output values have ${keys.length} keys, you must specify an output key or pass only 1 key as output`); | ||
} | ||
diff --git a/dist/memory.js b/dist/memory.js | ||
index 8e221f55b151d0ff7592b30ca34363b9ec577e01..a3ff2a514eda6c7e606e8f6d7305535b29ab671e 100644 | ||
--- a/dist/memory.js | ||
+++ b/dist/memory.js | ||
@@ -36,7 +36,7 @@ export const getInputValue = (inputValues, inputKey) => { | ||
*/ | ||
export const getOutputValue = (outputValues, outputKey) => { | ||
const value = getValue(outputValues, outputKey); | ||
- if (!value) { | ||
+ if (!value && value !== '') { | ||
const keys = Object.keys(outputValues); | ||
throw new Error(`output values have ${keys.length} keys, you must specify an output key or pass only 1 key as output`); | ||
} |
Oops, something went wrong.