File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -122,11 +122,11 @@ def execute(self, state: dict) -> dict:
122122 partial_variables = {"context" : doc , "format_instructions" : format_instructions }
123123 )
124124 chain = prompt | self .llm_model
125- raw_response = str (( prompt | self . llm_model ). invoke ({"question" : user_prompt }) )
125+ raw_response = chain . invoke ({"question" : user_prompt })
126126
127127 if output_parser :
128128 try :
129- answer = output_parser .parse (raw_response )
129+ answer = output_parser .parse (raw_response . content )
130130 except JSONDecodeError :
131131 lines = raw_response .split ('\n ' )
132132 if lines [0 ].strip ().startswith ('```' ):
@@ -136,7 +136,7 @@ def execute(self, state: dict) -> dict:
136136 cleaned_response = '\n ' .join (lines )
137137 answer = output_parser .parse (cleaned_response )
138138 else :
139- answer = raw_response
139+ answer = raw_response . content
140140
141141 state .update ({self .output [0 ]: answer })
142142 return state
You can’t perform that action at this time.
0 commit comments