Skip to content

Generate code for the activity step and add it to samples. #42492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 13, 2025
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
2 changes: 2 additions & 0 deletions sdk/ai/azure-ai-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

### Features Added

- Add `RunStepDetailsActivity`, describing MCP function parameters.

### Bugs Fixed

### Sample updates
Expand Down
7 changes: 4 additions & 3 deletions sdk/ai/azure-ai-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ The tool approval flow looks like this:
# Create and process agent run in thread with MCP tools
mcp_tool.update_headers("SuperSecret", "123456")
# mcp_tool.set_approval_mode("never") # Uncomment to disable approval requirement
run = agents_client.runs.create(thread_id=thread.id, agent_id=agent.id, tool_resources=mcp_tool.resources)
run = agents_client.runs.create(
thread_id=thread.id, agent_id=agent.id, tool_resources=mcp_tool.resources
)
print(f"Created run, ID: {run.id}")

while run.status in ["queued", "in_progress", "requires_action"]:
Expand Down Expand Up @@ -1083,8 +1085,7 @@ for run_step in agents_client.run_steps.list(thread_id=thread.id, run_id=run.id,
for tool_call in run_step.step_details.tool_calls:
if isinstance(tool_call, RunStepConnectedAgentToolCall):
print(
f"\tAgent: {tool_call.connected_agent.name} "
f"query: {tool_call.connected_agent.arguments} ",
f"\tAgent: {tool_call.connected_agent.name} " f"query: {tool_call.connected_agent.arguments} ",
f"output: {tool_call.connected_agent.output}",
)
```
Expand Down
7 changes: 6 additions & 1 deletion sdk/ai/azure-ai-agents/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"CrossLanguagePackageId": "Azure.AI.Agents",
"CrossLanguageDefinitionId": {
"azure.ai.agents.models.ActivityFunctionDefinition": "Azure.AI.Agents.ActivityFunctionDefinition",
"azure.ai.agents.models.ActivityFunctionParameters": "Azure.AI.Agents.ActivityFunctionParameters",
"azure.ai.agents.models.Agent": "Azure.AI.Agents.Agent",
"azure.ai.agents.models.AgentErrorDetail": "Azure.AI.Agents.AgentErrorDetail",
"azure.ai.agents.models.AgentsNamedToolChoice": "Azure.AI.Agents.AgentsNamedToolChoice",
Expand Down Expand Up @@ -42,6 +44,7 @@
"azure.ai.agents.models.FileSearchToolDefinition": "Azure.AI.Agents.FileSearchToolDefinition",
"azure.ai.agents.models.FileSearchToolDefinitionDetails": "Azure.AI.Agents.FileSearchToolDefinitionDetails",
"azure.ai.agents.models.FileSearchToolResource": "Azure.AI.Agents.FileSearchToolResource",
"azure.ai.agents.models.FunctionArgument": "Azure.AI.Agents.FunctionArgument",
"azure.ai.agents.models.FunctionDefinition": "Azure.AI.Agents.FunctionDefinition",
"azure.ai.agents.models.FunctionName": "Azure.AI.Agents.FunctionName",
"azure.ai.agents.models.FunctionToolDefinition": "Azure.AI.Agents.FunctionToolDefinition",
Expand Down Expand Up @@ -103,6 +106,8 @@
"azure.ai.agents.models.RunCompletionUsage": "Azure.AI.Agents.RunCompletionUsage",
"azure.ai.agents.models.RunError": "Azure.AI.Agents.RunError",
"azure.ai.agents.models.RunStep": "Azure.AI.Agents.RunStep",
"azure.ai.agents.models.RunStepDetails": "Azure.AI.Agents.RunStepDetails",
"azure.ai.agents.models.RunStepActivityDetails": "Azure.AI.Agents.RunStepActivityDetails",
"azure.ai.agents.models.RunStepToolCall": "Azure.AI.Agents.RunStepToolCall",
"azure.ai.agents.models.RunStepAzureAISearchToolCall": "Azure.AI.Agents.RunStepAzureAISearchToolCall",
"azure.ai.agents.models.RunStepBingCustomSearchToolCall": "Azure.AI.Agents.RunStepBingCustomSearchToolCall",
Expand Down Expand Up @@ -143,7 +148,7 @@
"azure.ai.agents.models.RunStepDeltaOpenAPIObject": "Azure.AI.Agents.RunStepDeltaOpenAPIObject",
"azure.ai.agents.models.RunStepDeltaOpenAPIToolCall": "Azure.AI.Agents.RunStepDeltaOpenAPIToolCall",
"azure.ai.agents.models.RunStepDeltaToolCallObject": "Azure.AI.Agents.RunStepDeltaToolCallObject",
"azure.ai.agents.models.RunStepDetails": "Azure.AI.Agents.RunStepDetails",
"azure.ai.agents.models.RunStepDetailsActivity": "Azure.AI.Agents.RunStepDetailsActivity",
"azure.ai.agents.models.RunStepError": "Azure.AI.Agents.RunStepError",
"azure.ai.agents.models.RunStepFileSearchToolCall": "Azure.AI.Agents.RunStepFileSearchToolCall",
"azure.ai.agents.models.RunStepFileSearchToolCallResult": "Azure.AI.Agents.RunStepFileSearchToolCallResult",
Expand Down
9 changes: 5 additions & 4 deletions sdk/ai/azure-ai-agents/azure/ai/agents/_utils/model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from azure.core import CaseInsensitiveEnumMeta
from azure.core.pipeline import PipelineResponse
from azure.core.serialization import _Null
from azure.core.rest import HttpResponse

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -940,13 +941,13 @@ def _deserialize(

def _failsafe_deserialize(
deserializer: typing.Any,
value: typing.Any,
response: HttpResponse,
module: typing.Optional[str] = None,
rf: typing.Optional["_RestField"] = None,
format: typing.Optional[str] = None,
) -> typing.Any:
try:
return _deserialize(deserializer, value, module, rf, format)
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
Expand All @@ -956,10 +957,10 @@ def _failsafe_deserialize(

def _failsafe_deserialize_xml(
deserializer: typing.Any,
value: typing.Any,
response: HttpResponse,
) -> typing.Any:
try:
return _deserialize_xml(deserializer, value)
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
Expand Down
Loading