rebase eval context extraction with query_memory tool

This commit is contained in:
Xi Yan 2025-01-15 12:06:49 -08:00
parent b7e59ba002
commit bae2896528

View file

@ -146,8 +146,12 @@ class MetaReferenceEvalImpl(
# check if there's a memory retrieval step and extract the context
memory_rag_context = None
for step in final_event.turn.steps:
if step.step_type == StepType.memory_retrieval.value:
memory_rag_context = " ".join(x.text for x in step.inserted_context)
if step.step_type == StepType.tool_execution.value:
for i, tool_response in enumerate(step.tool_responses):
if tool_response.tool_name == "query_memory":
memory_rag_context = " ".join(
x.text for x in tool_response.content
)
agent_generation = {}
agent_generation[ColumnName.generated_answer.value] = (