Skip to content

Commit f0ac82b

Browse files
committed
add extra answer key to state for convenience
1 parent 2ea6a72 commit f0ac82b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/graph.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class AgentState(TypedDict):
123123
query: str
124124
documents: Annotated[list[Document], update_documents]
125125
messages: Annotated[list[BaseMessage], add_messages]
126+
# for convenience in evaluations
127+
answer: str
126128

127129

128130
gpt_3_5 = ChatOpenAI(model="gpt-3.5-turbo-0125", temperature=0, streaming=True)
@@ -267,6 +269,7 @@ def synthesize_response(
267269
)
268270
return {
269271
"messages": [synthesized_response],
272+
"answer": synthesized_response.content
270273
}
271274

272275

0 commit comments

Comments
 (0)