From ea050f7fa891a4da0fffc2d442a75c6b5e13fcf4 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Fri, 21 Feb 2025 11:42:18 -0800 Subject: [PATCH] datetime nit --- .../providers/inline/agents/meta_reference/agent_instance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py index 1e41e5a01..edd253356 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py +++ b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py @@ -280,6 +280,7 @@ class ChatAgent(ShieldRunnerMixin): in_progress_tool_call_step = await self.storage.get_in_progress_tool_call_step( request.session_id, request.turn_id ) + now = datetime.now() tool_execution_step = ToolExecutionStep( step_id=(in_progress_tool_call_step.step_id if in_progress_tool_call_step else str(uuid.uuid4())), turn_id=request.turn_id, @@ -292,8 +293,8 @@ class ChatAgent(ShieldRunnerMixin): ) for x in request.tool_responses ], - completed_at=datetime.now(), - started_at=(in_progress_tool_call_step.started_at if in_progress_tool_call_step else datetime.now()), + completed_at=now, + started_at=(in_progress_tool_call_step.started_at if in_progress_tool_call_step else now), ) steps.append(tool_execution_step) yield AgentTurnResponseStreamChunk(