File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,13 @@ export abstract class BaseChain extends BaseLangChain implements ChainInputs {
5858 input : any ,
5959 callbacks ?: Callbacks
6060 ) : Promise < string > {
61- const isKeylessInput = this . inputKeys . length == = 1 ;
61+ const isKeylessInput = this . inputKeys . length < = 1 ;
6262 if ( ! isKeylessInput ) {
6363 throw new Error (
6464 `Chain ${ this . _chainType ( ) } expects multiple inputs, cannot use 'run' `
6565 ) ;
6666 }
67- const values = { [ this . inputKeys [ 0 ] ] : input } ;
67+ const values = this . inputKeys . length ? { [ this . inputKeys [ 0 ] ] : input } : { } ;
6868 const returnValues = await this . call ( values , callbacks ) ;
6969 const keys = Object . keys ( returnValues ) ;
7070
@@ -112,6 +112,7 @@ export abstract class BaseChain extends BaseLangChain implements ChainInputs {
112112 // add the runManager's currentRunId to the outputValues
113113 Object . defineProperty ( outputValues , RUN_KEY , {
114114 value : runManager ? { runId : runManager ?. runId } : undefined ,
115+ configurable : true ,
115116 } ) ;
116117 return outputValues ;
117118 }
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ export abstract class BaseChatModel extends BaseLanguageModel {
8383 await runManager ?. handleLLMEnd ( output ) ;
8484 Object . defineProperty ( output , RUN_KEY , {
8585 value : runManager ? { runId : runManager ?. runId } : undefined ,
86+ configurable : true ,
8687 } ) ;
8788 return output ;
8889 }
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ export abstract class BaseLLM extends BaseLanguageModel {
101101 // it isnt included when listing the keys of the output object.
102102 Object . defineProperty ( output , RUN_KEY , {
103103 value : runManager ? { runId : runManager ?. runId } : undefined ,
104+ configurable : true ,
104105 } ) ;
105106 return output ;
106107 }
You can’t perform that action at this time.
0 commit comments