Skip to content

Commit 83a1470

Browse files
authored
fix: access query value in output for online evals (#389)
* fix: access query value in output for online evals * chore: lint
1 parent c0de6a3 commit 83a1470

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

backend/retrieval_graph/graph.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ class Plan(TypedDict):
145145
{"role": "system", "content": configuration.research_plan_system_prompt}
146146
] + state.messages
147147
response = cast(Plan, await model.ainvoke(messages))
148-
return {"steps": response["steps"], "documents": "delete"}
148+
return {
149+
"steps": response["steps"],
150+
"documents": "delete",
151+
"query": state.messages[-1].content,
152+
}
149153

150154

151155
async def conduct_research(state: AgentState) -> dict[str, Any]:

backend/retrieval_graph/state.py

+1
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ class AgentState(InputState):
8181
"""Populated by the retriever. This is a list of documents that the agent can reference."""
8282
answer: str = field(default="")
8383
"""Final answer. Useful for evaluations"""
84+
query: str = field(default="")

0 commit comments

Comments
 (0)