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 7 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: 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

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions sdk/ai/azure-ai-agents/azure/ai/agents/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

from ._models import ( # type: ignore
AISearchIndexResource,
ActivityFunctionDefinition,
ActivityFunctionParameters,
Agent,
AgentErrorDetail,
AgentThread,
Expand Down Expand Up @@ -54,6 +56,7 @@
FileSearchToolDefinition,
FileSearchToolDefinitionDetails,
FileSearchToolResource,
FunctionArgument,
FunctionDefinition,
FunctionName,
FunctionToolDefinition,
Expand Down Expand Up @@ -115,6 +118,7 @@
RunCompletionUsage,
RunError,
RunStep,
RunStepActivityDetails,
RunStepAzureAISearchToolCall,
RunStepBingCustomSearchToolCall,
RunStepBingGroundingToolCall,
Expand Down Expand Up @@ -155,6 +159,7 @@
RunStepDeltaToolCall,
RunStepDeltaToolCallObject,
RunStepDetails,
RunStepDetailsActivity,
RunStepError,
RunStepFileSearchToolCall,
RunStepFileSearchToolCallResult,
Expand Down Expand Up @@ -247,6 +252,8 @@

__all__ = [
"AISearchIndexResource",
"ActivityFunctionDefinition",
"ActivityFunctionParameters",
"Agent",
"AgentErrorDetail",
"AgentThread",
Expand Down Expand Up @@ -286,6 +293,7 @@
"FileSearchToolDefinition",
"FileSearchToolDefinitionDetails",
"FileSearchToolResource",
"FunctionArgument",
"FunctionDefinition",
"FunctionName",
"FunctionToolDefinition",
Expand Down Expand Up @@ -347,6 +355,7 @@
"RunCompletionUsage",
"RunError",
"RunStep",
"RunStepActivityDetails",
"RunStepAzureAISearchToolCall",
"RunStepBingCustomSearchToolCall",
"RunStepBingGroundingToolCall",
Expand Down Expand Up @@ -387,6 +396,7 @@
"RunStepDeltaToolCall",
"RunStepDeltaToolCallObject",
"RunStepDetails",
"RunStepDetailsActivity",
"RunStepError",
"RunStepFileSearchToolCall",
"RunStepFileSearchToolCallResult",
Expand Down
2 changes: 2 additions & 0 deletions sdk/ai/azure-ai-agents/azure/ai/agents/models/_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ class RunStepType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Represents a run step to create a message."""
TOOL_CALLS = "tool_calls"
"""Represents a run step that calls tools."""
ACTIVITIES = "activities"
"""Represents a run step with activities information."""


class RunStreamEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta):
Expand Down
Loading
Loading