Skip to content

Commit

Permalink
fix: access query value in output for online evals (#389)
Browse files Browse the repository at this point in the history
* fix: access query value in output for online evals

* chore: lint
  • Loading branch information
davidx33 authored Oct 21, 2024
1 parent c0de6a3 commit 83a1470
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/retrieval_graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ class Plan(TypedDict):
{"role": "system", "content": configuration.research_plan_system_prompt}
] + state.messages
response = cast(Plan, await model.ainvoke(messages))
return {"steps": response["steps"], "documents": "delete"}
return {
"steps": response["steps"],
"documents": "delete",
"query": state.messages[-1].content,
}


async def conduct_research(state: AgentState) -> dict[str, Any]:
Expand Down
1 change: 1 addition & 0 deletions backend/retrieval_graph/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ class AgentState(InputState):
"""Populated by the retriever. This is a list of documents that the agent can reference."""
answer: str = field(default="")
"""Final answer. Useful for evaluations"""
query: str = field(default="")

0 comments on commit 83a1470

Please sign in to comment.