Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions py/src/braintrust/integrations/agno/_test_agno_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ async def _aexecute(self, session_id, user_id, execution_input, workflow_run_res
def _execute_stream(self, session, execution_input, workflow_run_response, run_context=None):
yield FakeEvent("WorkflowStarted", content=None)
yield FakeEvent("StepStarted", content=None)
yield FakeEvent("StepProgress", content="fetched 3/10", data={"completed": 3, "total": 10})
yield FakeEvent("StepCompleted", content="hello ")
yield FakeEvent("WorkflowCompleted", content="world", metrics=FakeMetrics(), status="COMPLETED")

Expand Down
2 changes: 1 addition & 1 deletion py/src/braintrust/integrations/agno/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_agno_workflow_stream_aggregates_workflow_events(memory_logger):
run_response = FakeWorkflowRunResponse(input="hello world")

chunks = list(workflow._execute_stream("session-1", execution_input, run_response))
assert len(chunks) == 4
assert len(chunks) == 5

spans = memory_logger.pop()
assert len(spans) == 1
Expand Down
2 changes: 1 addition & 1 deletion py/src/braintrust/integrations/agno/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def _aggregate_workflow_chunks(chunks: list[Any], workflow_run_response: Any | N
if hasattr(chunk, "content") and chunk.content:
if event == "WorkflowCompleted":
final_workflow_content = str(chunk.content)
elif final_workflow_content is None:
elif event != "StepProgress" and final_workflow_content is None:
aggregated["content"] += str(chunk.content)

if hasattr(chunk, "status") and chunk.status:
Expand Down
Loading