Skip to content

Commit 261d311

Browse files
.
1 parent bc89fc6 commit 261d311

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

tests/test_integrations/test_openai_agents/agents_app.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,23 @@ async def main3():
128128
with trace(workflow_name="test_workflow_2", group_id="test_group_id_2", metadata={"test_metadata_2": "test_metadata_2"}):
129129
response_1 = await Runner.run(triage_agent, "Hola, ¿cómo estás?", metric_collection="test_collection_1", thread_id="test")
130130

131+
async def main4():
132+
user_query = "What's the weather like in London today?"
133+
with trace(workflow_name="test_workflow_1", group_id="test_group_id_1", metadata={"test_metadata_1": "test_metadata_1"}):
134+
run_streamed_1 = Runner.run_streamed(weather_agent, user_query, metric_collection="test_collection_1")
135+
async for chunk in run_streamed_1.stream_events():
136+
print(chunk, end="", flush=True)
137+
print("=" * 50)
138+
run_streamed_2 = Runner.run_streamed(triage_agent, "Hola, ¿cómo estás?", metric_collection="test_collection_1", thread_id="test")
139+
async for chunk in run_streamed_2.stream_events():
140+
print(chunk, end="", flush=True)
141+
print("=" * 50)
142+
131143
def execute_agent():
132-
asyncio.run(main1())
133-
asyncio.run(main2())
134-
asyncio.run(main3())
144+
# asyncio.run(main1())
145+
# asyncio.run(main2())
146+
# asyncio.run(main3())
147+
asyncio.run(main4())
135148

136149

137150
# execute_agent()

0 commit comments

Comments
 (0)