mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: refresh dev dependencies and validate runtime bounds (#6238)
Updates third-party dev dependencies across the Python workspace and validates that all runtime dependency bounds still hold at both ends. Dev dependency bumps (root, lab, declarative, durabletask): - uv 0.11.6 -> 0.11.17, ruff 0.15.8 -> 0.15.15, pytest-asyncio 1.3.0 -> 1.4.0, mcp 1.27.0 -> 1.27.2, azure-monitor-opentelemetry 1.8.7 -> 1.8.8, poethepoet 0.42.1 -> 0.46.0, prek 0.3.9 -> 0.4.3, types-python-dateutil and types-PyYaml stub bumps. - Transitive Dependabot items swept via lock: idna 3.11 -> 3.17, pip 26.0.1 -> 26.1.2. Deliberately excluded: - opentelemetry-sdk stays 1.40.0: azure-monitor-opentelemetry (incl. 1.8.8) hard-pins opentelemetry-sdk==1.40. - mypy stays 1.20.0 and pyright stays 1.1.408: the 2.1.0 / 1.1.409 bumps introduce new diagnostics that fail type checking and need dedicated PRs. - rich kept as a range: agentlightning (lab[lightning]) forces rich==13.9.4. Code/formatting changes driven by the ruff upgrade: - devui lifespan now uses try/finally so shutdown cleanup always runs (ruff RUF075). - Removed unused TYPE_CHECKING imports in core and foundry flagged by ruff 0.15.15. - Reapplied ruff 0.15.15 formatting to the files it changed. Validation: validate-dependency-bounds-test "*" passes (31/31 lower + 31/31 upper); typing 62/62; lint 31/31; devui tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
52a8045bb6
commit
8091d052d8
@@ -109,7 +109,10 @@ async def main() -> None:
|
||||
print(f"\n [calling tool: {content.name}]", flush=True)
|
||||
print(" ", end="", flush=True)
|
||||
# Show web search activity when the result arrives with action details.
|
||||
elif content.type in ("search_tool_call", "search_tool_result") and getattr(content, "tool_name", None) == "web_search":
|
||||
elif (
|
||||
content.type in ("search_tool_call", "search_tool_result")
|
||||
and getattr(content, "tool_name", None) == "web_search"
|
||||
):
|
||||
action = None
|
||||
if content.type == "search_tool_result" and isinstance(content.result, dict):
|
||||
action = content.result.get("action", {})
|
||||
|
||||
@@ -74,19 +74,22 @@ async def run_agent_framework() -> None:
|
||||
client = OpenAIChatClient(model="gpt-4.1-mini")
|
||||
|
||||
# Create specialized agents
|
||||
python_expert = Agent(client=client,
|
||||
python_expert = Agent(
|
||||
client=client,
|
||||
name="python_expert",
|
||||
instructions="You are a Python programming expert. Answer Python-related questions.",
|
||||
description="Expert in Python programming",
|
||||
)
|
||||
|
||||
javascript_expert = Agent(client=client,
|
||||
javascript_expert = Agent(
|
||||
client=client,
|
||||
name="javascript_expert",
|
||||
instructions="You are a JavaScript programming expert. Answer JavaScript-related questions.",
|
||||
description="Expert in JavaScript programming",
|
||||
)
|
||||
|
||||
database_expert = Agent(client=client,
|
||||
database_expert = Agent(
|
||||
client=client,
|
||||
name="database_expert",
|
||||
instructions="You are a database expert. Answer SQL and database-related questions.",
|
||||
description="Expert in databases and SQL",
|
||||
@@ -95,7 +98,8 @@ async def run_agent_framework() -> None:
|
||||
workflow = GroupChatBuilder(
|
||||
participants=[python_expert, javascript_expert, database_expert],
|
||||
max_rounds=1,
|
||||
orchestrator_agent=Agent(client=client,
|
||||
orchestrator_agent=Agent(
|
||||
client=client,
|
||||
name="selector_manager",
|
||||
instructions="Based on the conversation, select the most appropriate expert to respond next.",
|
||||
),
|
||||
|
||||
@@ -113,7 +113,8 @@ async def run_agent_framework() -> None:
|
||||
client = OpenAIChatClient(model="gpt-4.1-mini")
|
||||
|
||||
# Create triage agent
|
||||
triage_agent = Agent(client=client,
|
||||
triage_agent = Agent(
|
||||
client=client,
|
||||
name="triage",
|
||||
instructions=(
|
||||
"You are a triage agent. Analyze the user's request and route to the appropriate specialist:\n"
|
||||
@@ -125,7 +126,8 @@ async def run_agent_framework() -> None:
|
||||
)
|
||||
|
||||
# Create billing specialist
|
||||
billing_agent = Agent(client=client,
|
||||
billing_agent = Agent(
|
||||
client=client,
|
||||
name="billing_agent",
|
||||
instructions="You are a billing specialist. Help with payment and billing questions. Provide clear assistance.",
|
||||
description="Handles billing and payment questions",
|
||||
@@ -133,7 +135,8 @@ async def run_agent_framework() -> None:
|
||||
)
|
||||
|
||||
# Create technical support specialist
|
||||
tech_support = Agent(client=client,
|
||||
tech_support = Agent(
|
||||
client=client,
|
||||
name="technical_support",
|
||||
instructions="You are technical support. Help with technical issues. Provide clear assistance.",
|
||||
description="Handles technical support questions",
|
||||
|
||||
@@ -73,7 +73,8 @@ async def run_agent_framework() -> None:
|
||||
|
||||
# Create agent with tool
|
||||
client = OpenAIChatClient(model="gpt-4.1-mini")
|
||||
agent = Agent(client=client,
|
||||
agent = Agent(
|
||||
client=client,
|
||||
name="assistant",
|
||||
instructions="You are a helpful assistant. Use available tools to answer questions.",
|
||||
tools=[get_weather],
|
||||
|
||||
@@ -61,7 +61,8 @@ async def run_agent_framework() -> None:
|
||||
client = OpenAIChatClient(model="gpt-4.1-mini")
|
||||
|
||||
# Create specialized writer agent
|
||||
writer = Agent(client=client,
|
||||
writer = Agent(
|
||||
client=client,
|
||||
name="writer",
|
||||
instructions="You are a creative writer. Write short, engaging content.",
|
||||
)
|
||||
@@ -75,7 +76,8 @@ async def run_agent_framework() -> None:
|
||||
)
|
||||
|
||||
# Create coordinator agent with writer tool
|
||||
coordinator = Agent(client=client,
|
||||
coordinator = Agent(
|
||||
client=client,
|
||||
name="coordinator",
|
||||
instructions="You coordinate with specialized agents. Delegate writing tasks to the writer agent.",
|
||||
tools=[writer_tool],
|
||||
|
||||
@@ -78,12 +78,14 @@ async def sk_agent_response_callback(
|
||||
async def run_agent_framework_example(prompt: str) -> list[Message]:
|
||||
client = OpenAIChatCompletionClient(credential=AzureCliCredential())
|
||||
|
||||
writer = Agent(client=client,
|
||||
writer = Agent(
|
||||
client=client,
|
||||
instructions=("You are a concise copywriter. Provide a single, punchy marketing sentence based on the prompt."),
|
||||
name="writer",
|
||||
)
|
||||
|
||||
reviewer = Agent(client=client,
|
||||
reviewer = Agent(
|
||||
client=client,
|
||||
instructions=("You are a thoughtful reviewer. Give brief feedback on the previous assistant message."),
|
||||
name="reviewer",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user