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
4 changes: 1 addition & 3 deletions python/packages/a2a/agent_framework_a2a/_a2a_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ async def handle_events(
artifact_id=artifact_id,
metadata=metadata,
append=(
True
if streamed_artifact_ids is not None and artifact_id in streamed_artifact_ids
else None
True if streamed_artifact_ids is not None and artifact_id in streamed_artifact_ids else None
),
)
if artifact_id and streamed_artifact_ids is not None:
Expand Down
3 changes: 1 addition & 2 deletions python/packages/core/agent_framework/_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
from pydantic import BaseModel

from ._agents import SupportsAgentRun
from ._clients import SupportsChatGetResponse
from ._compaction import CompactionStrategy, TokenizerProtocol
from ._sessions import AgentSession
from ._tools import FunctionTool, ToolTypes
from ._types import ChatOptions, ChatResponse, ChatResponseUpdate
from ._types import ChatOptions

ResponseModelBoundT = TypeVar("ResponseModelBoundT", bound=BaseModel)

Expand Down
7 changes: 2 additions & 5 deletions python/packages/core/agent_framework/_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -2134,9 +2134,7 @@ async def _run_script(
),
FunctionTool(
name="read_skill_resource",
description=(
"Reads a resource associated with a skill, such as references, assets, or dynamic data."
),
description=("Reads a resource associated with a skill, such as references, assets, or dynamic data."),
func=_read_resource,
input_model={
"type": "object",
Expand Down Expand Up @@ -2173,8 +2171,7 @@ async def _run_script(
"type": "object",
"additionalProperties": True,
"description": (
"Named arguments as key-value pairs "
'(e.g. {"length": 24, "uppercase": true}).'
'Named arguments as key-value pairs (e.g. {"length": 24, "uppercase": true}).'
),
},
{
Expand Down
8 changes: 4 additions & 4 deletions python/packages/core/tests/core/test_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -4086,8 +4086,8 @@ async def test_full_skill_content_contains_scripts(self) -> None:

async def test_content_is_cached(self) -> None:
skill = _MinimalClassSkill()
content1 = (await skill.get_content())
content2 = (await skill.get_content())
content1 = await skill.get_content()
content2 = await skill.get_content()
assert content1 is content2

def test_resources_are_lazy_cached(self) -> None:
Expand Down Expand Up @@ -5587,8 +5587,8 @@ class TestInlineSkillContentCaching:
async def test_content_cached_after_first_access(self) -> None:
"""InlineSkill.content returns the same object on subsequent accesses."""
skill = InlineSkill(frontmatter=SkillFrontmatter(name="test-skill", description="Test"), instructions="Body")
first = (await skill.get_content())
second = (await skill.get_content())
first = await skill.get_content()
second = await skill.get_content()
assert first is second # Same object (cached)
assert "<name>test-skill</name>" in first

Expand Down
2 changes: 1 addition & 1 deletion python/packages/declarative/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
]
[dependency-groups]
dev = [
"types-PyYaml==6.0.12.20250915"
"types-PyYaml==6.0.12.20260518"
]

[tool.uv]
Expand Down
16 changes: 9 additions & 7 deletions python/packages/devui/agent_framework_devui/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,15 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None]:
logger.info("Starting Agent Framework Server")
await self._ensure_executor()
await self._ensure_openai_executor() # Initialize OpenAI executor
yield
# Shutdown
logger.info("Shutting down Agent Framework Server")

# Cleanup entity resources (e.g., close credentials, clients)
if self.executor:
await self._cleanup_entities()
try:
yield
finally:
# Shutdown
logger.info("Shutting down Agent Framework Server")

# Cleanup entity resources (e.g., close credentials, clients)
if self.executor:
await self._cleanup_entities()

app = FastAPI(
title="Agent Framework Server",
Expand Down
2 changes: 1 addition & 1 deletion python/packages/durabletask/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [

[dependency-groups]
dev = [
"types-python-dateutil==2.9.0.20260402",
"types-python-dateutil==2.9.0.20260518",
]

[tool.uv]
Expand Down
2 changes: 0 additions & 2 deletions python/packages/foundry/agent_framework_foundry/_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
from agent_framework import (
Agent,
AgentRunInputs,
ChatAndFunctionMiddlewareTypes,
ContextProvider,
MiddlewareTypes,
ToolTypes,
)
Expand Down
8 changes: 4 additions & 4 deletions python/packages/lab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ math = [

[dependency-groups]
dev = [
"uv==0.11.6",
"ruff==0.15.8",
"uv==0.11.17",
"ruff==0.15.15",
"pytest==9.0.3",
"mypy==1.20.0",
"pyright==1.1.408",
#tasks
"poethepoet==0.42.1",
"poethepoet==0.46.0",
"rich>=13.7.1,<15.0.0",
"tomli==2.4.1",
"tomli-w==1.2.0",
# tau2 from source (not available on PyPI)
"tau2@ git+https://github.com/sierra-research/tau2-bench@5ba9e3e56db57c5e4114bf7f901291f09b2c5619",
"prek==0.3.9",
"prek==0.4.3",
]

[project.scripts]
Expand Down
14 changes: 7 additions & 7 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ dependencies = [

[dependency-groups]
dev = [
"uv==0.11.6",
"uv==0.11.17",
"flit==3.12.0",
"ruff==0.15.8",
"ruff==0.15.15",
"pytest==9.0.3",
"pytest-asyncio==1.3.0",
"pytest-asyncio==1.4.0",
"pytest-cov==7.1.0",
"pytest-xdist[psutil]==3.8.0",
"pytest-timeout==2.4.0",
"pytest-retry==1.7.0",
"mypy==1.20.0",
"pyright==1.1.408",
"mcp[ws]==1.27.0",
"mcp[ws]==1.27.2",
"opentelemetry-sdk==1.40.0",
"azure-monitor-opentelemetry==1.8.7",
"azure-monitor-opentelemetry==1.8.8",
#tasks
"poethepoet==0.42.1",
"poethepoet==0.46.0",
"rich>=13.7.1,<16.0.0",
"tomli==2.4.1",
"prek==0.3.9",
"prek==0.4.3",
]

[tool.uv]
Expand Down
5 changes: 4 additions & 1 deletion python/samples/02-agents/harness/harness_research.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", {})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.",
),
Expand Down
9 changes: 6 additions & 3 deletions python/samples/autogen-migration/orchestrations/03_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -125,15 +126,17 @@ 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",
require_per_service_call_history_persistence=True,
)

# 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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def get_weather(location: str) -> str:

# 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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
Expand All @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
6 changes: 1 addition & 5 deletions python/tests/samples/hosting/test_toolbox_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@
# Load the two sample modules by file path to avoid needing them on sys.path.
# ---------------------------------------------------------------------------
_RESPONSES_DIR = (
Path(__file__).parent.parent.parent.parent
/ "samples"
/ "04-hosting"
/ "foundry-hosted-agents"
/ "responses"
Path(__file__).parent.parent.parent.parent / "samples" / "04-hosting" / "foundry-hosted-agents" / "responses"
)


Expand Down
Loading
Loading