mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Update lab test trigger (#1632)
* Update lab test trigger * fix tests
This commit is contained in:
committed by
GitHub
Unverified
parent
1f19a6da5c
commit
064ee8afbe
@@ -1,14 +1,15 @@
|
||||
name: Python - Lab Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: ["main", "feature*"]
|
||||
paths:
|
||||
- "python/packages/lab/**"
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "python/packages/lab/**"
|
||||
merge_group:
|
||||
branches: ["main"]
|
||||
schedule:
|
||||
- cron: "0 0 * * *" # Run at midnight UTC daily
|
||||
|
||||
env:
|
||||
# Configure a constant location for the uv cache
|
||||
|
||||
@@ -10,6 +10,7 @@ from agent_framework import (
|
||||
ChatAgent,
|
||||
WorkflowBuilder,
|
||||
)
|
||||
from agent_framework._workflows._events import AgentRunEvent
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
from agent_framework_lab_lightning import init
|
||||
from agentlightning.adapter import TraceTripletAdapter
|
||||
@@ -110,7 +111,16 @@ def workflow_two_agents():
|
||||
async def test_openai_workflow_two_agents(workflow_two_agents):
|
||||
events = await workflow_two_agents.run("Please analyze the quarterly sales data")
|
||||
|
||||
assert "Based on the analysis 'Analyzed data shows trend upward', I recommend investing" in events.get_outputs()
|
||||
# Get all AgentRunEvent data
|
||||
agent_outputs = [event.data for event in events if isinstance(event, AgentRunEvent)]
|
||||
|
||||
# Check that we have outputs from both agents
|
||||
assert len(agent_outputs) == 2
|
||||
assert any("Analyzed data shows trend upward" in str(output) for output in agent_outputs)
|
||||
assert any(
|
||||
"Based on the analysis 'Analyzed data shows trend upward', I recommend investing" in str(output)
|
||||
for output in agent_outputs
|
||||
)
|
||||
|
||||
|
||||
async def test_observability(workflow_two_agents):
|
||||
|
||||
Reference in New Issue
Block a user