feat: log start, complete time to Agent steps (#1116)

This commit is contained in:
ehhuang 2025-02-14 17:48:06 -08:00 committed by GitHub
parent 8dc1cac333
commit ab2b46e528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -545,7 +545,7 @@ def test_create_turn_response(llama_stack_client, agent_config):
messages=[
{
"role": "user",
"content": "What is the boiling point of polyjuice?",
"content": "Call get_boiling_point and answer What is the boiling point of polyjuice?",
},
],
session_id=session_id,
@ -557,3 +557,12 @@ def test_create_turn_response(llama_stack_client, agent_config):
assert steps[1].step_type == "tool_execution"
assert steps[1].tool_calls[0].tool_name == "get_boiling_point"
assert steps[2].step_type == "inference"
last_step_completed_at = None
for step in steps:
if last_step_completed_at is None:
last_step_completed_at = step.completed_at
else:
assert last_step_completed_at < step.started_at
assert step.started_at < step.completed_at
last_step_completed_at = step.completed_at