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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
ComputerScreenshotContent,
CreateResponse,
FunctionCallOutputItemParam,
FunctionShellAction,
FunctionShellCallOutputContent,
FunctionShellCallOutputExitOutcome,
LocalEnvironmentResource,
MessageContent,
MessageContentInputFileContent,
MessageContentInputImageContent,
Expand Down Expand Up @@ -89,17 +93,12 @@ def __init__(
)
self._agent = agent

self.create_handler(self._handle_create) # pyright: ignore[reportUnknownMemberType]
self.response_handler(self._handler) # pyright: ignore[reportUnknownMemberType]

# Append the user agent prefix for telemetry purposes
append_to_user_agent(self.USER_AGENT_PREFIX)

self.create_handler(self._handle_create) # pyright: ignore[reportUnknownMemberType]

# Append the user agent prefix for telemetry purposes
append_to_user_agent(self.USER_AGENT_PREFIX)

async def _handle_create(
async def _handler(
self,
request: CreateResponse,
context: ResponseContext,
Expand Down Expand Up @@ -551,24 +550,26 @@ async def _to_outputs(stream: ResponseEventStream, content: Content) -> AsyncIte
async for event in stream.aoutput_item_custom_tool_call_output(content.call_id or "", output):
yield event
elif content.type == "shell_tool_call":
action: dict[str, Any] = {"type": "exec", "command": content.commands or []}
action = FunctionShellAction(commands=content.commands or [], timeout_ms=0, max_output_length=0)
async for event in stream.aoutput_item_function_shell_call(
content.call_id or "",
action,
{},
LocalEnvironmentResource(),
status=content.status or "completed",
):
yield event
elif content.type == "shell_tool_result":
output_items: list[dict[str, Any]] = []
output_items: list[FunctionShellCallOutputContent] = []
if content.outputs:
for out in content.outputs:
output_items.append({
"type": "shell_output",
"stdout": getattr(out, "stdout", "") or "",
"stderr": getattr(out, "stderr", "") or "",
"exit_code": getattr(out, "exit_code", None),
})
exit_code = getattr(out, "exit_code", None)
output_items.append(
FunctionShellCallOutputContent(
stdout=getattr(out, "stdout", "") or "",
stderr=getattr(out, "stderr", "") or "",
outcome=FunctionShellCallOutputExitOutcome(exit_code=exit_code if exit_code is not None else 0),
)
)
async for event in stream.aoutput_item_function_shell_call_output(
content.call_id or "",
output_items,
Expand Down
17 changes: 3 additions & 14 deletions python/packages/foundry_hosting/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,11 @@ classifiers = [
]
dependencies = [
"agent-framework-core>=1.0.0,<2",
"azure-ai-agentserver-core==2.0.0a20260414006",
"azure-ai-agentserver-responses==1.0.0a20260414006",
"azure-ai-agentserver-invocations==1.0.0a20260414006",
"azure-monitor-opentelemetry-exporter>=1.0.0a1"
"azure-ai-agentserver-core==2.0.0b1",
"azure-ai-agentserver-responses==1.0.0b1",
"azure-ai-agentserver-invocations==1.0.0b1",
]

[tool.uv.sources]
azure-ai-agentserver-responses = { index = "azure-sdk-for-python" }
azure-ai-agentserver-invocations = { index = "azure-sdk-for-python" }
azure-ai-agentserver-core = { index = "azure-sdk-for-python" }
azure-monitor-opentelemetry-exporter = { index = "azure-sdk-for-python" }

[[tool.uv.index]]
name = "azure-sdk-for-python"
url = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"

[tool.uv]
prerelease = "if-necessary-or-explicit"
environments = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ def main():
"You are an excellent content writer. You create new content and edit contents based on the feedback."
),
name="writer",
# History will be managed by the hosting infrastructure, thus there
# is no need to store history by the service. Learn more at:
# https://developers.openai.com/api/reference/resources/responses/methods/create
default_options={"store": False},
)

reviewer_agent = Agent(
Expand All @@ -48,10 +44,6 @@ def main():
"Provide the feedback in the most concise manner possible."
),
name="reviewer",
# History will be managed by the hosting infrastructure, thus there
# is no need to store history by the service. Learn more at:
# https://developers.openai.com/api/reference/resources/responses/methods/create
default_options={"store": False},
)

workflow_agent = (
Expand Down
40 changes: 19 additions & 21 deletions python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.