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:
122
122
partial_variables = {"context" : doc , "format_instructions" : format_instructions }
123
123
)
124
124
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 })
126
126
127
127
if output_parser :
128
128
try :
129
- answer = output_parser .parse (raw_response )
129
+ answer = output_parser .parse (raw_response . content )
130
130
except JSONDecodeError :
131
131
lines = raw_response .split ('\n ' )
132
132
if lines [0 ].strip ().startswith ('```' ):
@@ -136,7 +136,7 @@ def execute(self, state: dict) -> dict:
136
136
cleaned_response = '\n ' .join (lines )
137
137
answer = output_parser .parse (cleaned_response )
138
138
else :
139
- answer = raw_response
139
+ answer = raw_response . content
140
140
141
141
state .update ({self .output [0 ]: answer })
142
142
return state
You can’t perform that action at this time.
0 commit comments