From 8fe4ea0af5edc491e457edb756ea1eeeef0761df Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Mon, 19 Oct 2026 09:47:12 -0700 Subject: [PATCH 01/20] Update version to 2.10.0 and add tsp-location.yaml configuration file --- sdk/ai/azure-ai-projects/CHANGELOG.md | 2 ++ sdk/ai/azure-ai-projects/azure/ai/projects/_version.py | 2 +- .../{tsp-location.yaml.saved => tsp-location.yaml} | 0 3 files changed, 3 insertions(+), 1 deletion(-) rename sdk/ai/azure-ai-projects/{tsp-location.yaml.saved => tsp-location.yaml} (100%) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index a96f51c3578f..5b06b0d63697 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,5 +1,7 @@ # Release History +## 2.10.0 (Unreleased) + ## 2.9.0 (2026-10-16) ### Features Added diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py index 01239942fb5c..8dbc8389f5a3 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.9.0" +VERSION = "2.10.0" diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml similarity index 100% rename from sdk/ai/azure-ai-projects/tsp-location.yaml.saved rename to sdk/ai/azure-ai-projects/tsp-location.yaml From 41247123e5f152cc6f390d6f3125d2c6cb0fcfde Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Tue, 20 Oct 2026 14:38:54 -0700 Subject: [PATCH 02/20] [azure-ai-projects] Generate GPT Live APIs from TypeSpec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/emitter-package-lock.json | 8 +- eng/emitter-package.json | 2 +- sdk/ai/azure-ai-projects/CHANGELOG.md | 10 + sdk/ai/azure-ai-projects/api.md | 1735 +++- sdk/ai/azure-ai-projects/api.metadata.yml | 4 +- .../azure-ai-projects/apiview-properties.json | 133 +- .../azure/ai/projects/_unions.py | 10 +- .../ai/projects/aio/operations/_operations.py | 736 ++ .../azure/ai/projects/models/__init__.py | 202 + .../azure/ai/projects/models/_enums.py | 240 +- .../azure/ai/projects/models/_models.py | 8064 +++++++++++++---- .../azure/ai/projects/models/_patch.py | 27 + .../ai/projects/operations/_operations.py | 995 ++ .../azure-ai-projects/docs/public-methods.md | 15 +- .../tests/agents/test_realtime_client.py | 41 + sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 16 files changed, 10218 insertions(+), 2006 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 6dea4b09bc34..2ebd5e0eb399 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.63.10" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.28.0", + "@azure-tools/openai-typespec": "1.29.0", "@azure-tools/typespec-autorest": "~0.73.0", "@azure-tools/typespec-azure-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", @@ -31,9 +31,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.28.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.28.0.tgz", - "integrity": "sha1-rXCoTFopEeA3qKL8/P3Uim0ZuuA=", + "version": "1.29.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.29.0.tgz", + "integrity": "sha512-G4h4rgqB9NB3dcy8ayIHdLQ61D7r6G0WL/EQAKJ56lwPqtxjMXCWTskwjXleP3Dy7kDlpmh48SIaVLzmgidDPA==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 79c0abbe49bf..a1d14c4a3efd 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -22,6 +22,6 @@ "@azure-tools/typespec-client-generator-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", "@azure-tools/typespec-liftr-base": "0.13.0", - "@azure-tools/openai-typespec": "1.28.0" + "@azure-tools/openai-typespec": "1.29.0" } } diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 5b06b0d63697..f4ac283d9f1a 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -2,6 +2,16 @@ ## 2.10.0 (Unreleased) +### Features Added + +* Added generated GPT Live voice-agent configuration, delegation, and client/server event models. +* Added persisted Live conversation, item, and audio REST operations under `beta.voice_agents.live_conversations`. +* Added image-generation model options and the `xhigh` and `max` quality values from the updated OpenAI TypeSpec dependency. + +### Bugs Fixed + +* Preserved concrete Live/Realtime voice-agent types on agent readback without inserting an omitted `sub_protocol`. + ## 2.9.0 (2026-10-16) ### Features Added diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 65eafd3d828d..794ea298e6d7 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -6798,6 +6798,25 @@ namespace azure.ai.projects.models WEDNESDAY = "Wednesday" + class azure.ai.projects.models.Delegation(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DelegationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + RESPONSES = "responses" + + class azure.ai.projects.models.DeleteAgentResponse(_Model): deleted: bool name: str @@ -8340,6 +8359,7 @@ namespace azure.ai.projects.models code_configuration: Optional[CodeConfiguration] container_configuration: Optional[ContainerConfiguration] cpu: str + enable_memory_snapshot: Optional[bool] environment_variables: Optional[dict[str, str]] kind: Literal[AgentKind.HOSTED] memory: str @@ -8355,6 +8375,7 @@ namespace azure.ai.projects.models code_configuration: Optional[CodeConfiguration] = ..., container_configuration: Optional[ContainerConfiguration] = ..., cpu: str, + enable_memory_snapshot: Optional[bool] = ..., environment_variables: Optional[dict[str, str]] = ..., memory: str, protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., @@ -8420,13 +8441,13 @@ namespace azure.ai.projects.models description: Optional[str] input_fidelity: Optional[Union[str, InputFidelity]] input_image_mask: Optional[ImageGenToolInputImageMask] - model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], str]] + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-5-sunburst"], Literal["gpt-image-5-sunburst-2026-09-08"], Literal["gpt-image-5-flare"], Literal["gpt-image-5-flare-2026-09-08"], str]] moderation: Optional[Literal["auto", "low"]] name: Optional[str] output_compression: Optional[int] output_format: Optional[Literal["png", "webp", "jpeg"]] partial_images: Optional[int] - quality: Optional[Literal["low", "medium", "high", "auto"]] + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] tool_configs: Optional[dict[str, ToolConfig]] type: Literal[ToolType.IMAGE_GENERATION] @@ -8440,13 +8461,13 @@ namespace azure.ai.projects.models description: Optional[str] = ..., input_fidelity: Optional[Union[str, InputFidelity]] = ..., input_image_mask: Optional[ImageGenToolInputImageMask] = ..., - model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], str]] = ..., + model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], Literal[gpt-image-5-sunburst], Literal[gpt-image-5-sunburst-2026-09-08], Literal[gpt-image-5-flare], Literal[gpt-image-5-flare-2026-09-08], str]] = ..., moderation: Optional[Literal[auto, low]] = ..., name: Optional[str] = ..., output_compression: Optional[int] = ..., output_format: Optional[Literal[png, webp, jpeg]] = ..., partial_images: Optional[int] = ..., - quality: Optional[Literal[low, medium, high, auto]] = ..., + quality: Optional[Literal[low, medium, high, xhigh, max, auto]] = ..., size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @@ -8777,22 +8798,1382 @@ namespace azure.ai.projects.models def __init__( self, *, - agent_endpoint_id: Optional[str] = ..., - agent_name: Optional[str] = ..., - conversation: Optional[str] = ..., - input: Optional[Any] = ... + agent_endpoint_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + conversation: Optional[str] = ..., + input: Optional[Any] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + SUCCEEDED = "succeeded" + + + class azure.ai.projects.models.LiveAllowedServerEventParam(_Model): + response_event: Optional[str] + type: str + + @overload + def __init__( + self, + *, + response_event: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveAudioFormat(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO_PCM = "audio/pcm" + AUDIO_PCMA = "audio/pcma" + AUDIO_PCMU = "audio/pcmu" + + + class azure.ai.projects.models.LiveClientConfigParam(_Model): + data_channel: LiveDataChannelConfigParam + + @overload + def __init__( + self, + *, + data_channel: LiveDataChannelConfigParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientDelegationParam(Delegation, discriminator='client'): + type: Literal[DelegationType.CLIENT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEvent(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveCommentaryAppendParam(LiveClientEvent, discriminator='session.commentary.append'): + content: str + delegation_id: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_COMMENTARY_APPEND] + + @overload + def __init__( + self, + *, + content: str, + delegation_id: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveInputAudioAppendEvent(LiveClientEvent, discriminator='session.input_audio.append'): + audio: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_APPEND] + + @overload + def __init__( + self, + *, + audio: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveInputAudioMuteParam(LiveClientEvent, discriminator='session.input_audio.mute'): + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_MUTE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveInputAudioUnmuteParam(LiveClientEvent, discriminator='session.input_audio.unmute'): + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_UNMUTE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveInstructionsAppendParam(LiveClientEvent, discriminator='session.instructions.append'): + content: str + delegation_id: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_INSTRUCTIONS_APPEND] + + @overload + def __init__( + self, + *, + content: str, + delegation_id: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveResponseCreateParam(LiveClientEvent, discriminator='response.create'): + event_id: Optional[str] + type: Literal[LiveClientEventType.RESPONSE_CREATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveResponseItemCreateParam(LiveClientEvent, discriminator='response.item.create'): + event_id: Optional[str] + item: dict[str, Any] + type: Literal[LiveClientEventType.RESPONSE_ITEM_CREATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: dict[str, Any] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveSessionCloseParam(LiveClientEvent, discriminator='session.close'): + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_CLOSE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveSessionUpdateParam(LiveClientEvent, discriminator='session.update'): + event_id: Optional[str] + session: LiveSessionUpdateParams + type: Literal[LiveClientEventType.SESSION_UPDATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: LiveSessionUpdateParams + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveThinkingAppendParam(LiveClientEvent, discriminator='session.thinking.append'): + content: str + delegation_id: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_THINKING_APPEND] + + @overload + def __init__( + self, + *, + content: str, + delegation_id: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RESPONSE_CREATE = "response.create" + RESPONSE_ITEM_CREATE = "response.item.create" + SESSION_CLOSE = "session.close" + SESSION_COMMENTARY_APPEND = "session.commentary.append" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + SESSION_INPUT_AUDIO_MUTE = "session.input_audio.mute" + SESSION_INPUT_AUDIO_UNMUTE = "session.input_audio.unmute" + SESSION_INSTRUCTIONS_APPEND = "session.instructions.append" + SESSION_START = "session.start" + SESSION_THINKING_APPEND = "session.thinking.append" + SESSION_UPDATE = "session.update" + + + class azure.ai.projects.models.LiveContextWindowUsage(_Model): + usage_ratio: float + + @overload + def __init__( + self, + *, + usage_ratio: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveCustomVoiceParam(_Model): + id: str + + @overload + def __init__( + self, + *, + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveDataChannelConfigParam(_Model): + allowed_client_events: Optional[Union[Literal["all"], list[str]]] + allowed_server_events: Optional[Union[Literal["all"], list[LiveAllowedServerEventParam]]] + + @overload + def __init__( + self, + *, + allowed_client_events: Optional[Union[Literal[all], list[str]]] = ..., + allowed_server_events: Optional[Union[Literal[all], list[LiveAllowedServerEventParam]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveDelegationItem(_Model): + id: str + response_id: Optional[str] + target: Literal["client", "responses"] + type: Literal["delegation"] + + @overload + def __init__( + self, + *, + id: str, + response_id: Optional[str] = ..., + target: Literal["client", "responses"] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveDelegationReasoningInputParam(_Model): + effort: Optional[Union[str, LiveReasoningEffort]] + summary: Optional[Union[str, LiveReasoningSummary]] + + @overload + def __init__( + self, + *, + effort: Optional[Union[str, LiveReasoningEffort]] = ..., + summary: Optional[Union[str, LiveReasoningSummary]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveDelegationTextInputParam(_Model): + verbosity: Optional[Union[str, LiveTextVerbosity]] + + @overload + def __init__( + self, + *, + verbosity: Optional[Union[str, LiveTextVerbosity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveFunctionToolChoiceParam(_Model): + name: str + type: Literal["function"] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveFunctionToolInputParam(_Model): + description: Optional[str] + name: str + parameters: Optional[dict[str, Any]] + strict: Optional[bool] + type: Literal["function"] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + parameters: Optional[dict[str, Any]] = ..., + strict: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialAssistantMessageItemParam(LiveInitialItem, discriminator='assistant'): + content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]] + id: Optional[str] + role: Literal[LiveInitialItemType.ASSISTANT] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] + + @overload + def __init__( + self, + *, + content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialDeveloperMessageItemParam(LiveInitialItem, discriminator='developer'): + content: list[LiveInitialInputTextContentPartParam] + id: Optional[str] + role: Literal[LiveInitialItemType.DEVELOPER] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] + + @overload + def __init__( + self, + *, + content: list[LiveInitialInputTextContentPartParam], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialInputTextContentPartParam(_Model): + text: str + type: Optional[Literal["input_text"]] + + @overload + def __init__( + self, + *, + text: str, + type: Optional[Literal[input_text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialItem(_Model): + role: str + + @overload + def __init__( + self, + *, + role: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + DEVELOPER = "developer" + USER = "user" + + + class azure.ai.projects.models.LiveInitialMessageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + INCOMPLETE = "incomplete" + + + class azure.ai.projects.models.LiveInitialOutputTextContentPartParam(_Model): + text: str + type: Literal["output_text"] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialSessionAudioOutputParam(_Model): + voice: Optional[Union[str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], Literal["bossa"], Literal["cedar"], Literal["cinder"], Literal["coral"], Literal["delta"], Literal["echo"], Literal["gleam"], Literal["marin"], Literal["meridian"], Literal["quartz"], Literal["ripple"], Literal["sage"], Literal["shimmer"], Literal["stone"], Literal["tempo"], Literal["verse"], Literal["vesper"], Literal["willow"], LiveCustomVoiceParam]] + + @overload + def __init__( + self, + *, + voice: Optional[Union[str, Literal[alloy], Literal[ash], Literal[ballad], Literal[beacon], Literal[bossa], Literal[cedar], Literal[cinder], Literal[coral], Literal[delta], Literal[echo], Literal[gleam], Literal[marin], Literal[meridian], Literal[quartz], Literal[ripple], Literal[sage], Literal[shimmer], Literal[stone], Literal[tempo], Literal[verse], Literal[vesper], Literal[willow], LiveCustomVoiceParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialSessionAudioParam(_Model): + format: Optional[LiveAudioFormat] + output: Optional[LiveInitialSessionAudioOutputParam] + + @overload + def __init__( + self, + *, + format: Optional[LiveAudioFormat] = ..., + output: Optional[LiveInitialSessionAudioOutputParam] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialTextContentPartParam(_Model): + text: str + type: Optional[Literal["text"]] + + @overload + def __init__( + self, + *, + text: str, + type: Optional[Literal[text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialUserMessageItemParam(LiveInitialItem, discriminator='user'): + content: list[LiveInitialInputTextContentPartParam] + id: Optional[str] + role: Literal[LiveInitialItemType.USER] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] + + @overload + def __init__( + self, + *, + content: list[LiveInitialInputTextContentPartParam], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInputAudioAppend(LiveServerEvent, discriminator='session.input_audio.append'): + audio: str + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] + + @overload + def __init__( + self, + *, + audio: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveLiveError(_Model): + client_event_id: Optional[str] + code: str + message: str + param: Optional[str] + type: str + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + code: str, + message: str, + param: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveMCPToolChoiceParam(_Model): + name: str + server_label: str + type: Literal["mcp"] + + @overload + def __init__( + self, + *, + name: str, + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveOutputAudioDelta(LiveServerEvent, discriminator='session.output_audio.delta'): + delta: str + end_ms: Optional[int] + start_ms: Optional[int] + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA] + + @overload + def __init__( + self, + *, + delta: str, + end_ms: Optional[int] = ..., + start_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" + + + class azure.ai.projects.models.LiveReasoningSummary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + CONCISE = "concise" + DETAILED = "detailed" + + + class azure.ai.projects.models.LiveResponsesDelegationParam(Delegation, discriminator='responses'): + responses: LiveResponsesDelegationSettingsInputParam + type: Literal[DelegationType.RESPONSES] + + @overload + def __init__( + self, + *, + responses: LiveResponsesDelegationSettingsInputParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam(_Model): + instructions: Optional[str] + max_output_tokens: Optional[int] + model: str + parallel_tool_calls: Optional[bool] + reasoning: Optional[LiveDelegationReasoningInputParam] + service_tier: Optional[Union[str, LiveResponsesServiceTier]] + text: Optional[LiveDelegationTextInputParam] + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + max_output_tokens: Optional[int] = ..., + model: str, + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[LiveDelegationReasoningInputParam] = ..., + service_tier: Optional[Union[str, LiveResponsesServiceTier]] = ..., + text: Optional[LiveDelegationTextInputParam] = ..., + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] = ..., + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam(_Model): + instructions: Optional[str] + max_output_tokens: Optional[int] + model: Optional[str] + parallel_tool_calls: Optional[bool] + reasoning: Optional[LiveDelegationReasoningInputParam] + service_tier: Optional[Union[str, LiveResponsesServiceTier]] + text: Optional[LiveDelegationTextInputParam] + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + max_output_tokens: Optional[int] = ..., + model: Optional[str] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning: Optional[LiveDelegationReasoningInputParam] = ..., + service_tier: Optional[Union[str, LiveResponsesServiceTier]] = ..., + text: Optional[LiveDelegationTextInputParam] = ..., + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] = ..., + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveResponsesDelegationUpdateParam(_Model): + responses: Optional[LiveResponsesDelegationSettingsUpdateInputParam] + type: Literal["responses"] + + @overload + def __init__( + self, + *, + responses: Optional[LiveResponsesDelegationSettingsUpdateInputParam] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveResponsesServiceTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT = "default" + FAST_TIER_TEMP_PILOT = "fast_tier_temp_pilot" + FLEX = "flex" + PRIORITY = "priority" + ULTRAFAST = "ultrafast" + + + class azure.ai.projects.models.LiveServerEvent(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveCommentaryAppended(LiveServerEvent, discriminator='session.commentary.appended'): + client_event_id: Optional[str] + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_COMMENTARY_APPENDED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + end_ms: int, + event_id: str, + start_ms: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveDelegationCreated(LiveServerEvent, discriminator='session.delegation.created'): + client_event_id: Optional[str] + delegation: LiveDelegationItem + event_id: str + offset_ms: int + type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + delegation: LiveDelegationItem, + event_id: str, + offset_ms: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveErrorEvent(LiveServerEvent, discriminator='error'): + client_event_id: Optional[str] + error: LiveLiveError + event_id: str + type: Literal[LiveServerEventType.ERROR] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + error: LiveLiveError, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveInfoEvent(LiveServerEvent, discriminator='info'): + client_event_id: Optional[str] + code: str + event_id: str + message: str + type: Literal[LiveServerEventType.INFO] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + code: str, + event_id: str, + message: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveInputAudioMuted(LiveServerEvent, discriminator='session.input_audio.muted'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_MUTED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveInputAudioUnmuted(LiveServerEvent, discriminator='session.input_audio.unmuted'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveInputTranscriptDelta(LiveServerEvent, discriminator='session.input_transcript.delta'): + client_event_id: Optional[str] + delta: str + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + delta: str, + end_ms: int, + event_id: str, + start_ms: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveInstructionsAppended(LiveServerEvent, discriminator='session.instructions.appended'): + client_event_id: Optional[str] + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + end_ms: int, + event_id: str, + start_ms: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveOutputTranscriptDelta(LiveServerEvent, discriminator='session.output_transcript.delta'): + client_event_id: Optional[str] + delta: str + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + delta: str, + end_ms: int, + event_id: str, + start_ms: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveResponseEvent(LiveServerEvent, discriminator='response.event'): + client_event_id: Optional[str] + delegation_id: Optional[str] + event: dict[str, Any] + event_id: str + type: Literal[LiveServerEventType.RESPONSE_EVENT] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + delegation_id: Optional[str] = ..., + event: dict[str, Any], + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveSessionClosed(LiveServerEvent, discriminator='session.closed'): + client_event_id: Optional[str] + event_id: str + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] + session: LiveSessionResourceParam + type: Literal[LiveServerEventType.SESSION_CLOSED] + usage: LiveSessionUsage + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str, + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], + session: LiveSessionResourceParam, + usage: LiveSessionUsage + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveSessionStarted(LiveServerEvent, discriminator='session.started'): + client_event_id: Optional[str] + conversation_id: Optional[str] + event_id: str + session: LiveSessionResourceParam + type: Literal[LiveServerEventType.SESSION_STARTED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + conversation_id: Optional[str] = ..., + event_id: str, + session: LiveSessionResourceParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveSessionUpdated(LiveServerEvent, discriminator='session.updated'): + client_event_id: Optional[str] + event_id: str + session: LiveSessionResourceParam + type: Literal[LiveServerEventType.SESSION_UPDATED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str, + session: LiveSessionResourceParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveSessionUsageUpdated(LiveServerEvent, discriminator='session.usage.updated'): + client_event_id: Optional[str] + context_window: Optional[LiveContextWindowUsage] + event_id: str + type: Literal[LiveServerEventType.SESSION_USAGE_UPDATED] + usage: LiveSessionUsage + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + context_window: Optional[LiveContextWindowUsage] = ..., + event_id: str, + usage: LiveSessionUsage + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveThinkingAppended(LiveServerEvent, discriminator='session.thinking.appended'): + client_event_id: Optional[str] + end_ms: int + event_id: str + start_ms: int + type: Literal[LiveServerEventType.SESSION_THINKING_APPENDED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + end_ms: int, + event_id: str, + start_ms: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ERROR = "error" + INFO = "info" + RESPONSE_EVENT = "response.event" + SESSION_CLOSED = "session.closed" + SESSION_COMMENTARY_APPENDED = "session.commentary.appended" + SESSION_DELEGATION_CREATED = "session.delegation.created" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + SESSION_INPUT_AUDIO_MUTED = "session.input_audio.muted" + SESSION_INPUT_AUDIO_UNMUTED = "session.input_audio.unmuted" + SESSION_INPUT_TRANSCRIPT_DELTA = "session.input_transcript.delta" + SESSION_INSTRUCTIONS_APPENDED = "session.instructions.appended" + SESSION_OUTPUT_AUDIO_DELTA = "session.output_audio.delta" + SESSION_OUTPUT_TRANSCRIPT_DELTA = "session.output_transcript.delta" + SESSION_STARTED = "session.started" + SESSION_THINKING_APPENDED = "session.thinking.appended" + SESSION_UPDATED = "session.updated" + SESSION_USAGE_UPDATED = "session.usage.updated" + TRANSPORT_ANSWERED = "transport.answered" + TRANSPORT_DTMF_RECEIVED = "transport.dtmf.received" + TRANSPORT_DTMF_SEND = "transport.dtmf.send" + TRANSPORT_FAILED = "transport.failed" + TRANSPORT_RINGING = "transport.ringing" + + + class azure.ai.projects.models.LiveSessionAudioFormatPCMAParam(LiveAudioFormat, discriminator='audio/pcma'): + rate: int + type: Literal[LiveAudioFormatType.AUDIO_PCMA] + + @overload + def __init__( + self, + *, + rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionAudioFormatPCMParam(LiveAudioFormat, discriminator='audio/pcm'): + rate: Literal[16000, 24000] + type: Literal[LiveAudioFormatType.AUDIO_PCM] + + @overload + def __init__( + self, + *, + rate: Literal[16000, 24000] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionAudioFormatPCMUParam(LiveAudioFormat, discriminator='audio/pcmu'): + rate: int + type: Literal[LiveAudioFormatType.AUDIO_PCMU] + + @overload + def __init__( + self, + *, + rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionCreateParams(_Model): + audio: Optional[LiveInitialSessionAudioParam] + client: Optional[LiveClientConfigParam] + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] + input: Optional[list[LiveInitialItem]] + instructions: Optional[str] + model: Union[str, ModelIdsLive] + store: Optional[bool] + + @overload + def __init__( + self, + *, + audio: Optional[LiveInitialSessionAudioParam] = ..., + client: Optional[LiveClientConfigParam] = ..., + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] = ..., + input: Optional[list[LiveInitialItem]] = ..., + instructions: Optional[str] = ..., + model: Union[str, ModelIdsLive], + store: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionResourceParam(_Model): + audio: Optional[LiveInitialSessionAudioParam] + client: Optional[LiveClientConfigParam] + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] + expires_at: int + id: str + input: Optional[list[LiveInitialItem]] + instructions: Optional[str] + model: Union[str, ModelIdsLive] + status: Literal["active"] + store: Optional[bool] + + @overload + def __init__( + self, + *, + audio: Optional[LiveInitialSessionAudioParam] = ..., + client: Optional[LiveClientConfigParam] = ..., + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] = ..., + expires_at: int, + id: str, + input: Optional[list[LiveInitialItem]] = ..., + instructions: Optional[str] = ..., + model: Union[str, ModelIdsLive], + store: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionStartEvent(LiveClientEvent, discriminator='session.start'): + event_id: Optional[str] + session: LiveSessionCreateParams + type: Literal[LiveClientEventType.SESSION_START] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: LiveSessionCreateParams + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionUpdateParams(_Model): + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam]] + + @overload + def __init__( + self, + *, + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionUsage(_Model): + seconds: float + + @overload + def __init__( + self, + *, + seconds: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveTextVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.LiveToolChoiceEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.LiveTransportAnswered(LiveServerEvent, discriminator='transport.answered'): + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveTransportCallError(_Model): + code: str + message: str + param: Optional[str] + type: Literal["call_error"] + + @overload + def __init__( + self, + *, + code: str, + message: str, + param: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveTransportDTMFReceived(LiveServerEvent, discriminator='transport.dtmf.received'): + event: str + event_id: str + type: Literal[LiveServerEventType.TRANSPORT_DTMF_RECEIVED] + + @overload + def __init__( + self, + *, + event: str, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveTransportDTMFSend(LiveServerEvent, discriminator='transport.dtmf.send'): + event: str + event_id: str + type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] + + @overload + def __init__( + self, + *, + event: str, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveTransportFailed(LiveServerEvent, discriminator='transport.failed'): + error: LiveTransportCallError + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_FAILED] + + @overload + def __init__( + self, + *, + error: LiveTransportCallError, + event_id: str, + session_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveTransportRinging(LiveServerEvent, discriminator='transport.ringing'): + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_RINGING] + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - FAILED = "failed" - IN_PROGRESS = "in_progress" - QUEUED = "queued" - SUCCEEDED = "succeeded" + class azure.ai.projects.models.LiveWebSearchToolInputParam(_Model): + type: Literal["web_search"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... class azure.ai.projects.models.LocalShellToolParam(Tool, discriminator='local_shell'): @@ -9606,6 +10987,10 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ModelIdsLive(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GPT_LIVE1 = "gpt-live-1" + + class azure.ai.projects.models.ModelPendingUploadRequest(_Model): connection_name: Optional[str] pending_upload_id: Optional[str] @@ -15646,6 +17031,29 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentBaseDefinition(AgentDefinition, discriminator='voice'): + instructions: Optional[str] + kind: Literal[AgentKind.VOICE] + rai_config: RaiConfig + store: Optional[bool] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + sub_protocol: Optional[Union[str, VoiceAgentSubProtocol]] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + rai_config: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + sub_protocol: Optional[Union[str, VoiceAgentSubProtocol]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentClientEventRtcCallSdpCreate(RealtimeClientEvent, discriminator='rtc.call.sdp.create'): event_id: Optional[str] sdp_offer: str @@ -15700,23 +17108,24 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.VoiceAgentDefinition(AgentDefinition, discriminator='voice'): + class azure.ai.projects.models.VoiceAgentDefinition(VoiceAgentBaseDefinition): audio: Optional[VoiceAgentAudioConfig] avatar: Optional[VoiceAgentAvatarConfig] conversation_engine: Optional[VoiceConversationEngine] greeting: Optional[VoiceAgentGreetingConfig] include: Optional[list[Union[str, VoiceAgentSessionIncludeOption]]] - instructions: Optional[str] + instructions: str interim_response: Optional[VoiceAgentInterimResponseConfig] - kind: Literal[AgentKind.VOICE] + kind: Union[str, azure.ai.projects.models.VOICE] max_output_tokens: Optional[VoiceAgentMaxOutputTokens] model: Optional[str] model_type: Optional[Union[str, VoiceModelType]] output_modalities: Optional[list[Union[str, VoiceOutputModality]]] parallel_tool_calls: Optional[bool] rai_config: RaiConfig - store: Optional[bool] - structured_inputs: Optional[dict[str, StructuredInputDefinition]] + store: bool + structured_inputs: dict[str, StructuredInputDefinition] + sub_protocol: Optional[Literal["realtime"]] subagent_config: Optional[VoiceAgentSubagentConfig] tool_choice: Optional[VoiceAgentToolChoice] tools: Optional[list[VoiceAgentTool]] @@ -15740,6 +17149,7 @@ namespace azure.ai.projects.models rai_config: Optional[RaiConfig] = ..., store: Optional[bool] = ..., structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + sub_protocol: Optional[Literal[realtime]] = ..., subagent_config: Optional[VoiceAgentSubagentConfig] = ..., tool_choice: Optional[VoiceAgentToolChoice] = ..., tools: Optional[list[VoiceAgentTool]] = ... @@ -15915,6 +17325,288 @@ namespace azure.ai.projects.models TOOL = "tool" + class azure.ai.projects.models.VoiceAgentLiveClientDelegationConversationItem(VoiceAgentLiveDelegationConversationItem, discriminator='client'): + commentary: Optional[str] + created_at: datetime + id: str + response_id: str + target: Literal[VoiceAgentLiveDelegationTarget.CLIENT] + thinking: Optional[str] + type: Union[str, azure.ai.projects.models.DELEGATION] + + @overload + def __init__( + self, + *, + commentary: Optional[str] = ..., + created_at: datetime, + id: str, + response_id: Optional[str] = ..., + thinking: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveConversation(_Model): + completed_at: Optional[datetime] + created_at: datetime + id: str + last_error: Optional[ApiError] + metadata: Optional[dict[str, str]] + object: Literal["conversation"] + status: Union[str, VoiceConversationStatus] + usage: Optional[LiveSessionUsage] + + @overload + def __init__( + self, + *, + completed_at: Optional[datetime] = ..., + created_at: datetime, + id: str, + last_error: Optional[ApiError] = ..., + metadata: Optional[dict[str, str]] = ..., + status: Union[str, VoiceConversationStatus], + usage: Optional[LiveSessionUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveConversationItem(_Model): + id: str + type: str + + @overload + def __init__( + self, + *, + id: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELEGATION = "delegation" + INPUT = "input" + OUTPUT = "output" + + + class azure.ai.projects.models.VoiceAgentLiveDefinition(VoiceAgentBaseDefinition): + audio: Optional[LiveInitialSessionAudioParam] + delegation: Optional[VoiceAgentLiveDelegation] + greeting: Optional[VoiceAgentTemplateGreetingConfig] + instructions: str + kind: Union[str, azure.ai.projects.models.VOICE] + model: str + model_type: Literal["self_deployed"] + rai_config: RaiConfig + store: bool + structured_inputs: dict[str, StructuredInputDefinition] + sub_protocol: Literal["live"] + + @overload + def __init__( + self, + *, + audio: Optional[LiveInitialSessionAudioParam] = ..., + delegation: Optional[VoiceAgentLiveDelegation] = ..., + greeting: Optional[VoiceAgentTemplateGreetingConfig] = ..., + instructions: Optional[str] = ..., + model: str, + rai_config: Optional[RaiConfig] = ..., + store: Optional[bool] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveDelegationConversationItem(VoiceAgentLiveConversationItem, discriminator='delegation'): + created_at: datetime + id: str + response_id: Optional[str] + target: str + type: Literal[VoiceAgentLiveConversationItemType.DELEGATION] + + @overload + def __init__( + self, + *, + created_at: datetime, + id: str, + response_id: Optional[str] = ..., + target: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1(_Model): + commentary: Optional[str] + thinking: str + + @overload + def __init__( + self, + *, + commentary: Optional[str] = ..., + thinking: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2(_Model): + commentary: str + thinking: Optional[str] + + @overload + def __init__( + self, + *, + commentary: str, + thinking: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveDelegationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" + + + class azure.ai.projects.models.VoiceAgentLiveDelegationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + FOUNDRY_MANAGED_AGENT = "foundry_managed_agent" + RESPONSES = "responses" + + + class azure.ai.projects.models.VoiceAgentLiveFoundryManagedAgentDelegationItem(VoiceAgentLiveDelegationConversationItem, discriminator='foundry_managed_agent'): + agent_name: str + agent_version: str + backend_conversation_id: Optional[str] + created_at: datetime + delegation_context: Optional[str] + id: str + offset_ms: int + output: list[VoiceAgentLiveDelegationResultItem] + response_id: str + status: Union[str, VoiceAgentLiveDelegationStatus] + target: Literal[VoiceAgentLiveDelegationTarget.FOUNDRY_MANAGED_AGENT] + type: Union[str, azure.ai.projects.models.DELEGATION] + + @overload + def __init__( + self, + *, + agent_name: str, + agent_version: str, + backend_conversation_id: Optional[str] = ..., + created_at: datetime, + delegation_context: Optional[str] = ..., + id: str, + offset_ms: int, + output: list[VoiceAgentLiveDelegationResultItem], + response_id: Optional[str] = ..., + status: Union[str, VoiceAgentLiveDelegationStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveInputConversationItem(VoiceAgentLiveConversationItem, discriminator='input'): + audio: Optional[VoiceAudioItem] + id: str + transcription: Optional[str] + type: Literal[VoiceAgentLiveConversationItemType.INPUT] + + @overload + def __init__( + self, + *, + audio: Optional[VoiceAudioItem] = ..., + id: str, + transcription: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation(_Model): + agent_name: str + agent_version: Optional[str] + type: Literal["foundry_managed_agent"] + + @overload + def __init__( + self, + *, + agent_name: str, + agent_version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveOutputConversationItem(VoiceAgentLiveConversationItem, discriminator='output'): + audio: Optional[VoiceAudioItem] + id: str + transcription: Optional[str] + type: Literal[VoiceAgentLiveConversationItemType.OUTPUT] + + @overload + def __init__( + self, + *, + audio: Optional[VoiceAudioItem] = ..., + id: str, + transcription: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentLiveResponsesDelegationConversationItem(VoiceAgentLiveDelegationConversationItem, discriminator='responses'): + created_at: datetime + id: str + output: Optional[str] + response_id: str + target: Literal[VoiceAgentLiveDelegationTarget.RESPONSES] + type: Union[str, azure.ai.projects.models.DELEGATION] + + @overload + def __init__( + self, + *, + created_at: datetime, + id: str, + output: Optional[str] = ..., + response_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig(VoiceAgentGreetingConfig, discriminator='llm_generated'): prompt: str tool_choice: Optional[VoiceAgentToolChoice] @@ -16667,6 +18359,11 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentSubProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIVE = "live" + REALTIME = "realtime" + + class azure.ai.projects.models.VoiceAgentSubagent(_Model): agent_capabilities: str agent_name: str diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 6d6343ea5c66..f13e30cf6939 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: bb1ea6eb387aed40913818d64b40f39438c2e7800793c097bd7fea2fb0f4c3f3 -packageVersion: 2.9.0 +apiHash: e8c65b5d00eae3440a51d6626ac9a885a01f02fd53dfab0443c3bc54ea8eb5cd +packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.10 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 4a21720c683a..3ca298f3ec7c 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -194,6 +194,7 @@ "azure.ai.projects.models.DatasetEvaluatorGenerationJobSource": "Azure.AI.Projects.DatasetEvaluatorGenerationJobSource", "azure.ai.projects.models.DatasetReference": "Azure.AI.Projects.DatasetReference", "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", + "azure.ai.projects.models.Delegation": "OpenAI.delegation", "azure.ai.projects.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", "azure.ai.projects.models.DeleteAgentVersionResponse": "Azure.AI.Projects.DeleteAgentVersionResponse", "azure.ai.projects.models.DeleteMemoryResult": "Azure.AI.Projects.DeleteMemoryResponse", @@ -287,6 +288,77 @@ "azure.ai.projects.models.InvokeAgentInvocationsApiRoutineAction": "Azure.AI.Projects.InvokeAgentInvocationsApiRoutineAction", "azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload": "Azure.AI.Projects.InvokeAgentResponsesApiDispatchPayload", "azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction": "Azure.AI.Projects.InvokeAgentResponsesApiRoutineAction", + "azure.ai.projects.models.LiveAllowedServerEventParam": "OpenAI.LiveAllowedServerEventParam", + "azure.ai.projects.models.LiveAudioFormat": "OpenAI.LiveAudioFormat", + "azure.ai.projects.models.LiveClientConfigParam": "OpenAI.LiveClientConfigParam", + "azure.ai.projects.models.LiveClientDelegationParam": "OpenAI.LiveClientDelegationParam", + "azure.ai.projects.models.LiveClientEvent": "OpenAI.LiveClientEvent", + "azure.ai.projects.models.LiveClientEventLiveCommentaryAppendParam": "OpenAI.LiveClientEventLiveCommentaryAppendParam", + "azure.ai.projects.models.LiveClientEventLiveInputAudioAppendEvent": "OpenAI.LiveClientEventLiveInputAudioAppendEvent", + "azure.ai.projects.models.LiveClientEventLiveInputAudioMuteParam": "OpenAI.LiveClientEventLiveInputAudioMuteParam", + "azure.ai.projects.models.LiveClientEventLiveInputAudioUnmuteParam": "OpenAI.LiveClientEventLiveInputAudioUnmuteParam", + "azure.ai.projects.models.LiveClientEventLiveInstructionsAppendParam": "OpenAI.LiveClientEventLiveInstructionsAppendParam", + "azure.ai.projects.models.LiveClientEventLiveResponseCreateParam": "OpenAI.LiveClientEventLiveResponseCreateParam", + "azure.ai.projects.models.LiveClientEventLiveResponseItemCreateParam": "OpenAI.LiveClientEventLiveResponseItemCreateParam", + "azure.ai.projects.models.LiveClientEventLiveSessionCloseParam": "OpenAI.LiveClientEventLiveSessionCloseParam", + "azure.ai.projects.models.LiveClientEventLiveSessionUpdateParam": "OpenAI.LiveClientEventLiveSessionUpdateParam", + "azure.ai.projects.models.LiveClientEventLiveThinkingAppendParam": "OpenAI.LiveClientEventLiveThinkingAppendParam", + "azure.ai.projects.models.LiveContextWindowUsage": "OpenAI.LiveContextWindowUsage", + "azure.ai.projects.models.LiveCustomVoiceParam": "OpenAI.LiveCustomVoiceParam", + "azure.ai.projects.models.LiveDataChannelConfigParam": "OpenAI.LiveDataChannelConfigParam", + "azure.ai.projects.models.LiveDelegationItem": "OpenAI.LiveDelegationItem", + "azure.ai.projects.models.LiveDelegationReasoningInputParam": "OpenAI.LiveDelegationReasoningInputParam", + "azure.ai.projects.models.LiveDelegationTextInputParam": "OpenAI.LiveDelegationTextInputParam", + "azure.ai.projects.models.LiveFunctionToolChoiceParam": "OpenAI.LiveFunctionToolChoiceParam", + "azure.ai.projects.models.LiveFunctionToolInputParam": "OpenAI.LiveFunctionToolInputParam", + "azure.ai.projects.models.LiveInitialItem": "OpenAI.LiveInitialItem", + "azure.ai.projects.models.LiveInitialAssistantMessageItemParam": "OpenAI.LiveInitialAssistantMessageItemParam", + "azure.ai.projects.models.LiveInitialDeveloperMessageItemParam": "OpenAI.LiveInitialDeveloperMessageItemParam", + "azure.ai.projects.models.LiveInitialInputTextContentPartParam": "OpenAI.LiveInitialInputTextContentPartParam", + "azure.ai.projects.models.LiveInitialOutputTextContentPartParam": "OpenAI.LiveInitialOutputTextContentPartParam", + "azure.ai.projects.models.LiveInitialSessionAudioOutputParam": "OpenAI.LiveInitialSessionAudioOutputParam", + "azure.ai.projects.models.LiveInitialSessionAudioParam": "OpenAI.LiveInitialSessionAudioParam", + "azure.ai.projects.models.LiveInitialTextContentPartParam": "OpenAI.LiveInitialTextContentPartParam", + "azure.ai.projects.models.LiveInitialUserMessageItemParam": "OpenAI.LiveInitialUserMessageItemParam", + "azure.ai.projects.models.LiveServerEvent": "OpenAI.LiveServerEvent", + "azure.ai.projects.models.LiveInputAudioAppend": "OpenAI.LiveInputAudioAppend", + "azure.ai.projects.models.LiveLiveError": "OpenAI.LiveLiveError", + "azure.ai.projects.models.LiveMCPToolChoiceParam": "OpenAI.LiveMCPToolChoiceParam", + "azure.ai.projects.models.LiveOutputAudioDelta": "OpenAI.LiveOutputAudioDelta", + "azure.ai.projects.models.LiveResponsesDelegationParam": "OpenAI.LiveResponsesDelegationParam", + "azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam": "OpenAI.LiveResponsesDelegationSettingsInputParam", + "azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam": "OpenAI.LiveResponsesDelegationSettingsUpdateInputParam", + "azure.ai.projects.models.LiveResponsesDelegationUpdateParam": "OpenAI.LiveResponsesDelegationUpdateParam", + "azure.ai.projects.models.LiveServerEventLiveCommentaryAppended": "OpenAI.LiveServerEventLiveCommentaryAppended", + "azure.ai.projects.models.LiveServerEventLiveDelegationCreated": "OpenAI.LiveServerEventLiveDelegationCreated", + "azure.ai.projects.models.LiveServerEventLiveErrorEvent": "OpenAI.LiveServerEventLiveErrorEvent", + "azure.ai.projects.models.LiveServerEventLiveInfoEvent": "OpenAI.LiveServerEventLiveInfoEvent", + "azure.ai.projects.models.LiveServerEventLiveInputAudioMuted": "OpenAI.LiveServerEventLiveInputAudioMuted", + "azure.ai.projects.models.LiveServerEventLiveInputAudioUnmuted": "OpenAI.LiveServerEventLiveInputAudioUnmuted", + "azure.ai.projects.models.LiveServerEventLiveInputTranscriptDelta": "OpenAI.LiveServerEventLiveInputTranscriptDelta", + "azure.ai.projects.models.LiveServerEventLiveInstructionsAppended": "OpenAI.LiveServerEventLiveInstructionsAppended", + "azure.ai.projects.models.LiveServerEventLiveOutputTranscriptDelta": "OpenAI.LiveServerEventLiveOutputTranscriptDelta", + "azure.ai.projects.models.LiveServerEventLiveResponseEvent": "OpenAI.LiveServerEventLiveResponseEvent", + "azure.ai.projects.models.LiveServerEventLiveSessionClosed": "OpenAI.LiveServerEventLiveSessionClosed", + "azure.ai.projects.models.LiveServerEventLiveSessionStarted": "OpenAI.LiveServerEventLiveSessionStarted", + "azure.ai.projects.models.LiveServerEventLiveSessionUpdated": "OpenAI.LiveServerEventLiveSessionUpdated", + "azure.ai.projects.models.LiveServerEventLiveSessionUsageUpdated": "OpenAI.LiveServerEventLiveSessionUsageUpdated", + "azure.ai.projects.models.LiveServerEventLiveThinkingAppended": "OpenAI.LiveServerEventLiveThinkingAppended", + "azure.ai.projects.models.LiveSessionAudioFormatPCMAParam": "OpenAI.LiveSessionAudioFormatPCMAParam", + "azure.ai.projects.models.LiveSessionAudioFormatPCMParam": "OpenAI.LiveSessionAudioFormatPCMParam", + "azure.ai.projects.models.LiveSessionAudioFormatPCMUParam": "OpenAI.LiveSessionAudioFormatPCMUParam", + "azure.ai.projects.models.LiveSessionCreateParams": "OpenAI.LiveSessionCreateParams", + "azure.ai.projects.models.LiveSessionResourceParam": "OpenAI.LiveSessionResourceParam", + "azure.ai.projects.models.LiveSessionStartEvent": "OpenAI.LiveSessionStartEvent", + "azure.ai.projects.models.LiveSessionUpdateParams": "OpenAI.LiveSessionUpdateParams", + "azure.ai.projects.models.LiveSessionUsage": "OpenAI.LiveSessionUsage", + "azure.ai.projects.models.LiveTransportAnswered": "OpenAI.LiveTransportAnswered", + "azure.ai.projects.models.LiveTransportCallError": "OpenAI.LiveTransportCallError", + "azure.ai.projects.models.LiveTransportDTMFReceived": "OpenAI.LiveTransportDTMFReceived", + "azure.ai.projects.models.LiveTransportDTMFSend": "OpenAI.LiveTransportDTMFSend", + "azure.ai.projects.models.LiveTransportFailed": "OpenAI.LiveTransportFailed", + "azure.ai.projects.models.LiveTransportRinging": "OpenAI.LiveTransportRinging", + "azure.ai.projects.models.LiveWebSearchToolInputParam": "OpenAI.LiveWebSearchToolInputParam", "azure.ai.projects.models.LocalShellToolParam": "OpenAI.LocalShellToolParam", "azure.ai.projects.models.LocalSkillParam": "OpenAI.LocalSkillParam", "azure.ai.projects.models.LogProbProperties": "OpenAI.LogProbProperties", @@ -596,6 +668,7 @@ "azure.ai.projects.models.VoiceAgentAzureSemanticVadEnTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadEnTurnDetection", "azure.ai.projects.models.VoiceAgentAzureSemanticVadMultilingualTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadMultilingualTurnDetection", "azure.ai.projects.models.VoiceAgentAzureSemanticVadTurnDetection": "Azure.AI.Projects.VoiceAgentAzureSemanticVadTurnDetection", + "azure.ai.projects.models.VoiceAgentBaseDefinition": "Azure.AI.Projects.VoiceAgentBaseDefinition", "azure.ai.projects.models.VoiceAgentClientEventRtcCallSdpCreate": "Azure.AI.Projects.VoiceAgentClientEventRtcCallSdpCreate", "azure.ai.projects.models.VoiceAgentClientEventSessionAvatarConnect": "Azure.AI.Projects.VoiceAgentClientEventSessionAvatarConnect", "azure.ai.projects.models.VoiceAgentClientEventSessionUpdate": "Azure.AI.Projects.VoiceAgentClientEventSessionUpdate", @@ -609,6 +682,18 @@ "azure.ai.projects.models.VoiceAgentGreetingConfig": "Azure.AI.Projects.VoiceAgentGreetingConfig", "azure.ai.projects.models.VoiceAgentInputTranscription": "Azure.AI.Projects.VoiceAgentInputTranscription", "azure.ai.projects.models.VoiceAgentInterimResponseConfig": "Azure.AI.Projects.VoiceAgentInterimResponseConfig", + "azure.ai.projects.models.VoiceAgentLiveConversationItem": "Azure.AI.Projects.VoiceAgentLiveConversationItem", + "azure.ai.projects.models.VoiceAgentLiveDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveDelegationConversationItem", + "azure.ai.projects.models.VoiceAgentLiveClientDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveClientDelegationConversationItem", + "azure.ai.projects.models.VoiceAgentLiveConversation": "Azure.AI.Projects.VoiceAgentLiveConversation", + "azure.ai.projects.models.VoiceAgentLiveDefinition": "Azure.AI.Projects.VoiceAgentLiveDefinition", + "azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1": "Azure.AI.Projects.VoiceAgentLiveDelegationResultItem.anonymous", + "azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2": "Azure.AI.Projects.VoiceAgentLiveDelegationResultItem.anonymous", + "azure.ai.projects.models.VoiceAgentLiveFoundryManagedAgentDelegationItem": "Azure.AI.Projects.VoiceAgentLiveFoundryManagedAgentDelegationItem", + "azure.ai.projects.models.VoiceAgentLiveInputConversationItem": "Azure.AI.Projects.VoiceAgentLiveInputConversationItem", + "azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation": "Azure.AI.Projects.VoiceAgentLiveManagedAgentDelegation", + "azure.ai.projects.models.VoiceAgentLiveOutputConversationItem": "Azure.AI.Projects.VoiceAgentLiveOutputConversationItem", + "azure.ai.projects.models.VoiceAgentLiveResponsesDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveResponsesDelegationConversationItem", "azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig": "Azure.AI.Projects.VoiceAgentLlmGeneratedGreetingConfig", "azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", "azure.ai.projects.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", @@ -679,6 +764,9 @@ "azure.ai.projects.models.VoiceAudioRole": "Azure.AI.Projects.VoiceAudioRole", "azure.ai.projects.models.VoiceAudioContainerFormat": "Azure.AI.Projects.VoiceAudioContainerFormat", "azure.ai.projects.models.VoiceAudioCodec": "Azure.AI.Projects.VoiceAudioCodec", + "azure.ai.projects.models.VoiceAgentLiveConversationItemType": "Azure.AI.Projects.VoiceAgentLiveConversationItemType", + "azure.ai.projects.models.VoiceAgentLiveDelegationTarget": "Azure.AI.Projects.VoiceAgentLiveDelegationTarget", + "azure.ai.projects.models.VoiceAgentLiveDelegationStatus": "Azure.AI.Projects.VoiceAgentLiveDelegationStatus", "azure.ai.projects.models.TelephonyProvider": "Azure.AI.Projects.TelephonyProvider", "azure.ai.projects.models.TelephonyBindingStatus": "Azure.AI.Projects.TelephonyBindingStatus", "azure.ai.projects.models.TelephonyCallStatus": "Azure.AI.Projects.TelephonyCallStatus", @@ -733,21 +821,7 @@ "azure.ai.projects.models.SearchContentType": "OpenAI.SearchContentType", "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", - "azure.ai.projects.models.VoiceModelType": "Azure.AI.Projects.VoiceModelType", - "azure.ai.projects.models.VoiceAgentNoiseReductionType": "Azure.AI.Projects.VoiceAgentNoiseReductionType", - "azure.ai.projects.models.VoiceAgentTurnDetectionType": "Azure.AI.Projects.VoiceAgentTurnDetectionType", - "azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetectionModel", - "azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", - "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", - "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", - "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", - "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", - "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", - "azure.ai.projects.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", - "azure.ai.projects.models.VoiceAgentAvatarType": "Azure.AI.Projects.VoiceAgentAvatarType", - "azure.ai.projects.models.VoiceAgentAvatarOutputProtocol": "Azure.AI.Projects.VoiceAgentAvatarOutputProtocol", - "azure.ai.projects.models.VoiceAgentToolResponseScheduling": "Azure.AI.Projects.VoiceAgentToolResponseScheduling", - "azure.ai.projects.models.VoiceAgentSystemToolName": "Azure.AI.Projects.VoiceAgentSystemToolName", + "azure.ai.projects.models.VoiceAgentSubProtocol": "Azure.AI.Projects.VoiceAgentSubProtocol", "azure.ai.projects.models.AgentVersionStatus": "Azure.AI.Projects.AgentVersionStatus", "azure.ai.projects.models.AgentIdentityStatus": "Azure.AI.Projects.AgentIdentityStatus", "azure.ai.projects.models.AgentBlueprintReferenceType": "Azure.AI.Projects.AgentBlueprintReferenceType", @@ -756,6 +830,9 @@ "azure.ai.projects.models.AgentEndpointAuthorizationSchemeType": "Azure.AI.Projects.AgentEndpointAuthorizationSchemeType", "azure.ai.projects.models.PublishApprovalStatus": "Azure.AI.Projects.PublishApprovalStatus", "azure.ai.projects.models.DigitalWorkerType": "Azure.AI.Projects.DigitalWorkerType", + "azure.ai.projects.models.VoiceModelType": "Azure.AI.Projects.VoiceModelType", + "azure.ai.projects.models.VoiceAgentToolResponseScheduling": "Azure.AI.Projects.VoiceAgentToolResponseScheduling", + "azure.ai.projects.models.VoiceAgentSystemToolName": "Azure.AI.Projects.VoiceAgentSystemToolName", "azure.ai.projects.models.AgentInsightOverviewSource": "Azure.AI.Projects.AgentInsightOverviewSource", "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", "azure.ai.projects.models.AgentInsightRunTrigger": "Azure.AI.Projects.AgentInsightRunTrigger", @@ -834,6 +911,25 @@ "azure.ai.projects.models.RubricGenerationInputQualityWarningSource": "Azure.AI.Projects.RubricGenerationInputQualityWarningSource", "azure.ai.projects.models.ToolboxToolType": "Azure.AI.Projects.ToolboxToolType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", + "azure.ai.projects.models.VoiceAgentNoiseReductionType": "Azure.AI.Projects.VoiceAgentNoiseReductionType", + "azure.ai.projects.models.VoiceAgentTurnDetectionType": "Azure.AI.Projects.VoiceAgentTurnDetectionType", + "azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceDetectionModel", + "azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", + "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", + "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", + "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", + "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", + "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", + "azure.ai.projects.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", + "azure.ai.projects.models.VoiceAgentAvatarType": "Azure.AI.Projects.VoiceAgentAvatarType", + "azure.ai.projects.models.VoiceAgentAvatarOutputProtocol": "Azure.AI.Projects.VoiceAgentAvatarOutputProtocol", + "azure.ai.projects.models.LiveAudioFormatType": "OpenAI.LiveAudioFormatType", + "azure.ai.projects.models.DelegationType": "OpenAI.DelegationType", + "azure.ai.projects.models.LiveResponsesServiceTier": "OpenAI.LiveResponsesServiceTier", + "azure.ai.projects.models.LiveReasoningEffort": "OpenAI.LiveReasoningEffort", + "azure.ai.projects.models.LiveReasoningSummary": "OpenAI.LiveReasoningSummary", + "azure.ai.projects.models.LiveTextVerbosity": "OpenAI.LiveTextVerbosity", + "azure.ai.projects.models.LiveToolChoiceEnum": "OpenAI.LiveToolChoiceEnum", "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", "azure.ai.projects.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", @@ -841,6 +937,11 @@ "azure.ai.projects.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", "azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", "azure.ai.projects.models.VoiceAgentSubagentAbortReason": "Azure.AI.Projects.VoiceAgentSubagentAbortReason", + "azure.ai.projects.models.LiveClientEventType": "OpenAI.LiveClientEventType", + "azure.ai.projects.models.ModelIdsLive": "OpenAI.ModelIdsLive", + "azure.ai.projects.models.LiveInitialItemType": "OpenAI.LiveInitialItemType", + "azure.ai.projects.models.LiveInitialMessageStatus": "OpenAI.LiveInitialMessageStatus", + "azure.ai.projects.models.LiveServerEventType": "OpenAI.LiveServerEventType", "azure.ai.projects.models.VoiceAgentTransport": "Azure.AI.Projects.VoiceAgentTransport", "azure.ai.projects.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", "azure.ai.projects.aio.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", @@ -999,5 +1100,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "05e1b80a337b" + "CrossLanguageVersion": "f075953027d8" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py index 73da9e2b48ee..da3be90e6ce6 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -10,12 +10,20 @@ if TYPE_CHECKING: from . import models as _models +VoiceAgentLiveDelegationResultItem: TypeAlias = Union[ + "_models.VoiceAgentLiveDelegationResultItem2", "_models.VoiceAgentLiveDelegationResultItem1" +] Filters: TypeAlias = Union["_models.ComparisonFilter", "_models.CompoundFilter"] +RoutineRunStatus: TypeAlias = str VoiceAgentToolChoice: TypeAlias = Union[ Literal["none"], Literal["auto"], Literal["required"], "_models.ToolChoiceFunction", "_models.ToolChoiceMCP" ] VoiceAgentMaxOutputTokens: TypeAlias = Union[int, Literal["inf"]] -RoutineRunStatus: TypeAlias = str +VoiceAgentLiveDelegation: TypeAlias = Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationParam", + "_models.VoiceAgentLiveManagedAgentDelegation", +] VoiceAgentSessionUpdate: TypeAlias = "_models.VoiceAgentSessionUpdateConfig" VoiceAgentSessionResponse: TypeAlias = "_models.VoiceAgentSessionResponseConfig" GenerateAgentRequest: TypeAlias = "_models.GenerateVoiceAgentRequest" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index a4c93a7c971c..56548426f018 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -161,6 +161,15 @@ build_beta_voice_agents_conversations_list_request, build_beta_voice_agents_conversations_list_response_items_request, build_beta_voice_agents_conversations_list_responses_request, + build_beta_voice_agents_live_conversations_delete_request, + build_beta_voice_agents_live_conversations_download_audio_item_request, + build_beta_voice_agents_live_conversations_download_audio_request, + build_beta_voice_agents_live_conversations_get_audio_item_request, + build_beta_voice_agents_live_conversations_get_audio_request, + build_beta_voice_agents_live_conversations_get_item_request, + build_beta_voice_agents_live_conversations_get_request, + build_beta_voice_agents_live_conversations_list_items_request, + build_beta_voice_agents_live_conversations_list_request, build_beta_voice_agents_telephony_cancel_call_job_request, build_beta_voice_agents_telephony_create_binding_request, build_beta_voice_agents_telephony_create_call_job_request, @@ -8984,6 +8993,9 @@ def __init__(self, *args, **kwargs) -> None: self.conversations = BetaVoiceAgentsConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.live_conversations = BetaVoiceAgentsLiveConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.telephony = BetaVoiceAgentsTelephonyOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -18424,6 +18436,730 @@ async def download_audio(self, agent_name: str, conversation_id: str, **kwargs: return deserialized # type: ignore +class BetaVoiceAgentsLiveConversationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`live_conversations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceAgentLiveConversation"]: + """List Live voice agent conversations. + + Lists stored Live conversations for this agent, including sessions stored via an override. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversation + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_request( + agent_name=agent_name, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversation], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) + + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceAgentLiveConversation: + """Get a Live voice agent conversation. + + Gets a stored Live conversation; fetch items separately. Returns 404 if absent or not stored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceAgentLiveConversation. The VoiceAgentLiveConversation is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversation] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, agent_name: str, conversation_id: str, **kwargs: Any) -> None: + """Delete a Live voice agent conversation. + + Deletes the stored conversation and its items/audio, without closing the Live session. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_delete_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_items( + self, + agent_name: str, + conversation_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.VoiceAgentLiveConversationItem"]: + """List items in a Live voice agent conversation. + + Lists stored speech and delegation items in order; cursors use item IDs. Returns 404 if the + conversation is absent or unstored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversationItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversationItem]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversationItem], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) + + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAgentLiveConversationItem: + """Get a Live voice agent conversation item. + + Gets a stored item by ID. Returns 404 if the item or conversation is absent. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAgentLiveConversationItem. The VoiceAgentLiveConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversationItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversationItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAudioItem: + """Get a Live conversation item's audio metadata. + + Gets captured speech-audio metadata. BYOS uses unsigned blob_uri. Returns 404 for missing + audio, unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAudioItem. The VoiceAudioItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAudioItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAudioItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAudioItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def download_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Stream a Live conversation item's audio. + + Streams captured speech as WAV. BYOS returns 409; use blob_uri. Returns 404 for missing audio, + unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceRecording: + """Get a Live conversation's merged recording metadata. + + Gets merged stereo recording metadata (user left, assistant right). BYOS uses unsigned + blob_uri. Returns 404 for no audio, or 409 recording_not_ready/recording_unavailable for + pending/failed finalization; pending responses may include Retry-After. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceRecording. The VoiceRecording is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecording + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceRecording] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecording, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> AsyncIterator[bytes]: + """Stream a Live conversation's merged recording. + + Streams the merged stereo WAV. BYOS returns 409; use blob_uri. Returns 404 for no audio, or 409 + recording_not_ready/recording_unavailable for pending/failed finalization. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param """ .. warning:: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index 2442af4e0e21..56688b3fadc9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -192,6 +192,7 @@ DatasetEvaluatorGenerationJobSource, DatasetReference, DatasetVersion, + Delegation, DeleteAgentResponse, DeleteAgentVersionResponse, DeleteMemoryResult, @@ -289,6 +290,77 @@ InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiDispatchPayload, InvokeAgentResponsesApiRoutineAction, + LiveAllowedServerEventParam, + LiveAudioFormat, + LiveClientConfigParam, + LiveClientDelegationParam, + LiveClientEvent, + LiveClientEventLiveCommentaryAppendParam, + LiveClientEventLiveInputAudioAppendEvent, + LiveClientEventLiveInputAudioMuteParam, + LiveClientEventLiveInputAudioUnmuteParam, + LiveClientEventLiveInstructionsAppendParam, + LiveClientEventLiveResponseCreateParam, + LiveClientEventLiveResponseItemCreateParam, + LiveClientEventLiveSessionCloseParam, + LiveClientEventLiveSessionUpdateParam, + LiveClientEventLiveThinkingAppendParam, + LiveContextWindowUsage, + LiveCustomVoiceParam, + LiveDataChannelConfigParam, + LiveDelegationItem, + LiveDelegationReasoningInputParam, + LiveDelegationTextInputParam, + LiveFunctionToolChoiceParam, + LiveFunctionToolInputParam, + LiveInitialAssistantMessageItemParam, + LiveInitialDeveloperMessageItemParam, + LiveInitialInputTextContentPartParam, + LiveInitialItem, + LiveInitialOutputTextContentPartParam, + LiveInitialSessionAudioOutputParam, + LiveInitialSessionAudioParam, + LiveInitialTextContentPartParam, + LiveInitialUserMessageItemParam, + LiveInputAudioAppend, + LiveLiveError, + LiveMCPToolChoiceParam, + LiveOutputAudioDelta, + LiveResponsesDelegationParam, + LiveResponsesDelegationSettingsInputParam, + LiveResponsesDelegationSettingsUpdateInputParam, + LiveResponsesDelegationUpdateParam, + LiveServerEvent, + LiveServerEventLiveCommentaryAppended, + LiveServerEventLiveDelegationCreated, + LiveServerEventLiveErrorEvent, + LiveServerEventLiveInfoEvent, + LiveServerEventLiveInputAudioMuted, + LiveServerEventLiveInputAudioUnmuted, + LiveServerEventLiveInputTranscriptDelta, + LiveServerEventLiveInstructionsAppended, + LiveServerEventLiveOutputTranscriptDelta, + LiveServerEventLiveResponseEvent, + LiveServerEventLiveSessionClosed, + LiveServerEventLiveSessionStarted, + LiveServerEventLiveSessionUpdated, + LiveServerEventLiveSessionUsageUpdated, + LiveServerEventLiveThinkingAppended, + LiveSessionAudioFormatPCMAParam, + LiveSessionAudioFormatPCMParam, + LiveSessionAudioFormatPCMUParam, + LiveSessionCreateParams, + LiveSessionResourceParam, + LiveSessionStartEvent, + LiveSessionUpdateParams, + LiveSessionUsage, + LiveTransportAnswered, + LiveTransportCallError, + LiveTransportDTMFReceived, + LiveTransportDTMFSend, + LiveTransportFailed, + LiveTransportRinging, + LiveWebSearchToolInputParam, LocalShellToolParam, LocalSkillParam, LogProbProperties, @@ -609,6 +681,7 @@ VoiceAgentAzureSemanticVadEnTurnDetection, VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentAzureSemanticVadTurnDetection, + VoiceAgentBaseDefinition, VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect, VoiceAgentClientEventSessionUpdate, @@ -620,6 +693,18 @@ VoiceAgentGreetingConfig, VoiceAgentInputTranscription, VoiceAgentInterimResponseConfig, + VoiceAgentLiveClientDelegationConversationItem, + VoiceAgentLiveConversation, + VoiceAgentLiveConversationItem, + VoiceAgentLiveDefinition, + VoiceAgentLiveDelegationConversationItem, + VoiceAgentLiveDelegationResultItem1, + VoiceAgentLiveDelegationResultItem2, + VoiceAgentLiveFoundryManagedAgentDelegationItem, + VoiceAgentLiveInputConversationItem, + VoiceAgentLiveManagedAgentDelegation, + VoiceAgentLiveOutputConversationItem, + VoiceAgentLiveResponsesDelegationConversationItem, VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentLlmInterimResponseConfig, VoiceAgentMcpTool, @@ -731,6 +816,7 @@ DataGenerationJobType, DatasetType, DayOfWeek, + DelegationType, DeploymentType, DigitalWorkerType, EvaluationLevel, @@ -758,6 +844,16 @@ InputFidelity, InsightType, JobStatus, + LiveAudioFormatType, + LiveClientEventType, + LiveInitialItemType, + LiveInitialMessageStatus, + LiveReasoningEffort, + LiveReasoningSummary, + LiveResponsesServiceTier, + LiveServerEventType, + LiveTextVerbosity, + LiveToolChoiceEnum, MemoryItemKind, MemoryOperationKind, MemoryStoreKind, @@ -766,6 +862,7 @@ Microsoft365PublishScope, MicrosoftCopilotBuiltInTool, MisalignmentErrorType, + ModelIdsLive, OpenApiAuthType, OperationState, OptimizationContextType, @@ -845,8 +942,12 @@ VoiceAgentEndOfUtteranceThresholdLevel, VoiceAgentInputTranscriptionModel, VoiceAgentInterimResponseTrigger, + VoiceAgentLiveConversationItemType, + VoiceAgentLiveDelegationStatus, + VoiceAgentLiveDelegationTarget, VoiceAgentNoiseReductionType, VoiceAgentSessionIncludeOption, + VoiceAgentSubProtocol, VoiceAgentSubagentAbortReason, VoiceAgentSystemToolName, VoiceAgentToolResponseScheduling, @@ -1042,6 +1143,7 @@ "DatasetEvaluatorGenerationJobSource", "DatasetReference", "DatasetVersion", + "Delegation", "DeleteAgentResponse", "DeleteAgentVersionResponse", "DeleteMemoryResult", @@ -1139,6 +1241,77 @@ "InvokeAgentInvocationsApiRoutineAction", "InvokeAgentResponsesApiDispatchPayload", "InvokeAgentResponsesApiRoutineAction", + "LiveAllowedServerEventParam", + "LiveAudioFormat", + "LiveClientConfigParam", + "LiveClientDelegationParam", + "LiveClientEvent", + "LiveClientEventLiveCommentaryAppendParam", + "LiveClientEventLiveInputAudioAppendEvent", + "LiveClientEventLiveInputAudioMuteParam", + "LiveClientEventLiveInputAudioUnmuteParam", + "LiveClientEventLiveInstructionsAppendParam", + "LiveClientEventLiveResponseCreateParam", + "LiveClientEventLiveResponseItemCreateParam", + "LiveClientEventLiveSessionCloseParam", + "LiveClientEventLiveSessionUpdateParam", + "LiveClientEventLiveThinkingAppendParam", + "LiveContextWindowUsage", + "LiveCustomVoiceParam", + "LiveDataChannelConfigParam", + "LiveDelegationItem", + "LiveDelegationReasoningInputParam", + "LiveDelegationTextInputParam", + "LiveFunctionToolChoiceParam", + "LiveFunctionToolInputParam", + "LiveInitialAssistantMessageItemParam", + "LiveInitialDeveloperMessageItemParam", + "LiveInitialInputTextContentPartParam", + "LiveInitialItem", + "LiveInitialOutputTextContentPartParam", + "LiveInitialSessionAudioOutputParam", + "LiveInitialSessionAudioParam", + "LiveInitialTextContentPartParam", + "LiveInitialUserMessageItemParam", + "LiveInputAudioAppend", + "LiveLiveError", + "LiveMCPToolChoiceParam", + "LiveOutputAudioDelta", + "LiveResponsesDelegationParam", + "LiveResponsesDelegationSettingsInputParam", + "LiveResponsesDelegationSettingsUpdateInputParam", + "LiveResponsesDelegationUpdateParam", + "LiveServerEvent", + "LiveServerEventLiveCommentaryAppended", + "LiveServerEventLiveDelegationCreated", + "LiveServerEventLiveErrorEvent", + "LiveServerEventLiveInfoEvent", + "LiveServerEventLiveInputAudioMuted", + "LiveServerEventLiveInputAudioUnmuted", + "LiveServerEventLiveInputTranscriptDelta", + "LiveServerEventLiveInstructionsAppended", + "LiveServerEventLiveOutputTranscriptDelta", + "LiveServerEventLiveResponseEvent", + "LiveServerEventLiveSessionClosed", + "LiveServerEventLiveSessionStarted", + "LiveServerEventLiveSessionUpdated", + "LiveServerEventLiveSessionUsageUpdated", + "LiveServerEventLiveThinkingAppended", + "LiveSessionAudioFormatPCMAParam", + "LiveSessionAudioFormatPCMParam", + "LiveSessionAudioFormatPCMUParam", + "LiveSessionCreateParams", + "LiveSessionResourceParam", + "LiveSessionStartEvent", + "LiveSessionUpdateParams", + "LiveSessionUsage", + "LiveTransportAnswered", + "LiveTransportCallError", + "LiveTransportDTMFReceived", + "LiveTransportDTMFSend", + "LiveTransportFailed", + "LiveTransportRinging", + "LiveWebSearchToolInputParam", "LocalShellToolParam", "LocalSkillParam", "LogProbProperties", @@ -1459,6 +1632,7 @@ "VoiceAgentAzureSemanticVadEnTurnDetection", "VoiceAgentAzureSemanticVadMultilingualTurnDetection", "VoiceAgentAzureSemanticVadTurnDetection", + "VoiceAgentBaseDefinition", "VoiceAgentClientEventRtcCallSdpCreate", "VoiceAgentClientEventSessionAvatarConnect", "VoiceAgentClientEventSessionUpdate", @@ -1470,6 +1644,18 @@ "VoiceAgentGreetingConfig", "VoiceAgentInputTranscription", "VoiceAgentInterimResponseConfig", + "VoiceAgentLiveClientDelegationConversationItem", + "VoiceAgentLiveConversation", + "VoiceAgentLiveConversationItem", + "VoiceAgentLiveDefinition", + "VoiceAgentLiveDelegationConversationItem", + "VoiceAgentLiveDelegationResultItem1", + "VoiceAgentLiveDelegationResultItem2", + "VoiceAgentLiveFoundryManagedAgentDelegationItem", + "VoiceAgentLiveInputConversationItem", + "VoiceAgentLiveManagedAgentDelegation", + "VoiceAgentLiveOutputConversationItem", + "VoiceAgentLiveResponsesDelegationConversationItem", "VoiceAgentLlmGeneratedGreetingConfig", "VoiceAgentLlmInterimResponseConfig", "VoiceAgentMcpTool", @@ -1578,6 +1764,7 @@ "DataGenerationJobType", "DatasetType", "DayOfWeek", + "DelegationType", "DeploymentType", "DigitalWorkerType", "EvaluationLevel", @@ -1605,6 +1792,16 @@ "InputFidelity", "InsightType", "JobStatus", + "LiveAudioFormatType", + "LiveClientEventType", + "LiveInitialItemType", + "LiveInitialMessageStatus", + "LiveReasoningEffort", + "LiveReasoningSummary", + "LiveResponsesServiceTier", + "LiveServerEventType", + "LiveTextVerbosity", + "LiveToolChoiceEnum", "MemoryItemKind", "MemoryOperationKind", "MemoryStoreKind", @@ -1613,6 +1810,7 @@ "Microsoft365PublishScope", "MicrosoftCopilotBuiltInTool", "MisalignmentErrorType", + "ModelIdsLive", "OpenApiAuthType", "OperationState", "OptimizationContextType", @@ -1692,8 +1890,12 @@ "VoiceAgentEndOfUtteranceThresholdLevel", "VoiceAgentInputTranscriptionModel", "VoiceAgentInterimResponseTrigger", + "VoiceAgentLiveConversationItemType", + "VoiceAgentLiveDelegationStatus", + "VoiceAgentLiveDelegationTarget", "VoiceAgentNoiseReductionType", "VoiceAgentSessionIncludeOption", + "VoiceAgentSubProtocol", "VoiceAgentSubagentAbortReason", "VoiceAgentSystemToolName", "VoiceAgentToolResponseScheduling", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 2c54cd780175..4030e4ed31e9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -698,6 +698,15 @@ class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Saturday.""" +class DelegationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of DelegationType.""" + + CLIENT = "client" + """CLIENT.""" + RESPONSES = "responses" + """RESPONSES.""" + + class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of DeploymentType.""" @@ -998,6 +1007,180 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Job was cancelled by the caller.""" +class LiveAudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveAudioFormatType.""" + + AUDIO_PCM = "audio/pcm" + """AUDIO_PCM.""" + AUDIO_PCMU = "audio/pcmu" + """AUDIO_PCMU.""" + AUDIO_PCMA = "audio/pcma" + """AUDIO_PCMA.""" + + +class LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveClientEventType.""" + + SESSION_START = "session.start" + """SESSION_START.""" + SESSION_UPDATE = "session.update" + """SESSION_UPDATE.""" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + """SESSION_INPUT_AUDIO_APPEND.""" + SESSION_INPUT_AUDIO_MUTE = "session.input_audio.mute" + """SESSION_INPUT_AUDIO_MUTE.""" + SESSION_INPUT_AUDIO_UNMUTE = "session.input_audio.unmute" + """SESSION_INPUT_AUDIO_UNMUTE.""" + SESSION_INSTRUCTIONS_APPEND = "session.instructions.append" + """SESSION_INSTRUCTIONS_APPEND.""" + SESSION_THINKING_APPEND = "session.thinking.append" + """SESSION_THINKING_APPEND.""" + SESSION_COMMENTARY_APPEND = "session.commentary.append" + """SESSION_COMMENTARY_APPEND.""" + RESPONSE_ITEM_CREATE = "response.item.create" + """RESPONSE_ITEM_CREATE.""" + RESPONSE_CREATE = "response.create" + """RESPONSE_CREATE.""" + SESSION_CLOSE = "session.close" + """SESSION_CLOSE.""" + + +class LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveInitialItemType.""" + + DEVELOPER = "developer" + """DEVELOPER.""" + USER = "user" + """USER.""" + ASSISTANT = "assistant" + """ASSISTANT.""" + + +class LiveInitialMessageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveInitialMessageStatus.""" + + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + COMPLETED = "completed" + """COMPLETED.""" + + +class LiveReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveReasoningEffort.""" + + NONE = "none" + """NONE.""" + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + + +class LiveReasoningSummary(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveReasoningSummary.""" + + CONCISE = "concise" + """CONCISE.""" + DETAILED = "detailed" + """DETAILED.""" + AUTO = "auto" + """AUTO.""" + + +class LiveResponsesServiceTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveResponsesServiceTier.""" + + AUTO = "auto" + """AUTO.""" + DEFAULT = "default" + """DEFAULT.""" + FAST_TIER_TEMP_PILOT = "fast_tier_temp_pilot" + """FAST_TIER_TEMP_PILOT.""" + FLEX = "flex" + """FLEX.""" + PRIORITY = "priority" + """PRIORITY.""" + ULTRAFAST = "ultrafast" + """ULTRAFAST.""" + + +class LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveServerEventType.""" + + SESSION_STARTED = "session.started" + """SESSION_STARTED.""" + SESSION_UPDATED = "session.updated" + """SESSION_UPDATED.""" + SESSION_INPUT_AUDIO_MUTED = "session.input_audio.muted" + """SESSION_INPUT_AUDIO_MUTED.""" + SESSION_INPUT_AUDIO_UNMUTED = "session.input_audio.unmuted" + """SESSION_INPUT_AUDIO_UNMUTED.""" + SESSION_INSTRUCTIONS_APPENDED = "session.instructions.appended" + """SESSION_INSTRUCTIONS_APPENDED.""" + SESSION_THINKING_APPENDED = "session.thinking.appended" + """SESSION_THINKING_APPENDED.""" + SESSION_COMMENTARY_APPENDED = "session.commentary.appended" + """SESSION_COMMENTARY_APPENDED.""" + SESSION_INPUT_AUDIO_APPEND = "session.input_audio.append" + """SESSION_INPUT_AUDIO_APPEND.""" + SESSION_OUTPUT_AUDIO_DELTA = "session.output_audio.delta" + """SESSION_OUTPUT_AUDIO_DELTA.""" + SESSION_INPUT_TRANSCRIPT_DELTA = "session.input_transcript.delta" + """SESSION_INPUT_TRANSCRIPT_DELTA.""" + SESSION_OUTPUT_TRANSCRIPT_DELTA = "session.output_transcript.delta" + """SESSION_OUTPUT_TRANSCRIPT_DELTA.""" + SESSION_DELEGATION_CREATED = "session.delegation.created" + """SESSION_DELEGATION_CREATED.""" + RESPONSE_EVENT = "response.event" + """RESPONSE_EVENT.""" + SESSION_USAGE_UPDATED = "session.usage.updated" + """SESSION_USAGE_UPDATED.""" + SESSION_CLOSED = "session.closed" + """SESSION_CLOSED.""" + ERROR = "error" + """ERROR.""" + INFO = "info" + """INFO.""" + TRANSPORT_DTMF_RECEIVED = "transport.dtmf.received" + """TRANSPORT_DTMF_RECEIVED.""" + TRANSPORT_DTMF_SEND = "transport.dtmf.send" + """TRANSPORT_DTMF_SEND.""" + TRANSPORT_RINGING = "transport.ringing" + """TRANSPORT_RINGING.""" + TRANSPORT_ANSWERED = "transport.answered" + """TRANSPORT_ANSWERED.""" + TRANSPORT_FAILED = "transport.failed" + """TRANSPORT_FAILED.""" + + +class LiveTextVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveTextVerbosity.""" + + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + + +class LiveToolChoiceEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveToolChoiceEnum.""" + + AUTO = "auto" + """AUTO.""" + NONE = "none" + """NONE.""" + REQUIRED = "required" + """REQUIRED.""" + + class MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Memory item kind.""" @@ -1094,6 +1277,15 @@ class MisalignmentErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OTHER.""" +class ModelIdsLive(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Live model. Required in the session configuration for every transport; do not pass it as a + URL query parameter. + """ + + GPT_LIVE1 = "gpt-live-1" + """GPT_LIVE1.""" + + class OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Authentication type for OpenApi endpoint. Allowed types are: @@ -1436,7 +1628,7 @@ class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): ``minimal``, ``low``, ``medium``, ``high``, ``xhigh``, and ``max``. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the `reasoning guide - `_ for model-specific support. + `_ for model-specific support. """ NONE = "none" @@ -2499,6 +2691,43 @@ class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumM """TOOL.""" +class VoiceAgentLiveConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of a persisted Live conversation item.""" + + INPUT = "input" + """INPUT.""" + OUTPUT = "output" + """OUTPUT.""" + DELEGATION = "delegation" + """DELEGATION.""" + + +class VoiceAgentLiveDelegationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Persisted delegation outcome, not speech or playback status.""" + + IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" + COMPLETED = "completed" + """COMPLETED.""" + FAILED = "failed" + """FAILED.""" + INCOMPLETE = "incomplete" + """INCOMPLETE.""" + CANCELLED = "cancelled" + """CANCELLED.""" + + +class VoiceAgentLiveDelegationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delegation owner. Foundry agent targets use native client delegation upstream.""" + + RESPONSES = "responses" + """RESPONSES.""" + CLIENT = "client" + """CLIENT.""" + FOUNDRY_MANAGED_AGENT = "foundry_managed_agent" + """FOUNDRY_MANAGED_AGENT.""" + + class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The input audio noise reduction mode.""" @@ -2538,6 +2767,15 @@ class VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta """The consultation failed.""" +class VoiceAgentSubProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Voice protocol; realtime includes cascaded models.""" + + REALTIME = "realtime" + """REALTIME.""" + LIVE = "live" + """LIVE.""" + + class VoiceAgentSystemToolName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A service-managed voice-session control action. Known values are stable; additional values may be added over time. diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 5d5140de90d8..53e19b5444b5 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -32,6 +32,7 @@ DataGenerationJobSourceType, DataGenerationJobType, DatasetType, + DelegationType, DeploymentType, EvaluationRuleActionType, EvaluationTaxonomyInputType, @@ -40,6 +41,10 @@ FunctionShellToolParamEnvironmentType, IndexType, InsightType, + LiveAudioFormatType, + LiveClientEventType, + LiveInitialItemType, + LiveServerEventType, MemoryItemKind, MemoryStoreKind, MemoryStoreObjectType, @@ -71,6 +76,8 @@ TriggerType, VersionIndicatorType, VersionSelectorType, + VoiceAgentLiveConversationItemType, + VoiceAgentLiveDelegationTarget, VoiceAgentSystemToolName, VoiceAgentTurnDetectionType, ) @@ -960,8 +967,8 @@ class AgentDefinition(_Model): # pylint: disable=docstring-keyword-should-match """AgentDefinition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, VoiceAgentDefinition, - WorkflowAgentDefinition + ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, + VoiceAgentBaseDefinition, WorkflowAgentDefinition :ivar kind: Required. Known values are: "prompt", "hosted", "workflow", "external", and "voice". @@ -8905,6 +8912,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class Delegation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Who handles tasks delegated by the Live model. Omitted or null selects your application; use + ``responses`` to let the API manage a Responses backend. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveClientDelegationParam, LiveResponsesDelegationParam + + :ivar type: Required. Known values are: "client" and "responses". + :vartype type: str or ~azure.ai.projects.models.DelegationType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"client\" and \"responses\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class DeleteAgentResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A deleted agent Object. @@ -11695,9 +11735,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionParameters(_Model): """The parameters the functions accepts, described as a JSON Schema object. See the `guide - `_ for examples, and the `JSON Schema reference - `_ for documentation about the format. - Omitting ``parameters`` defines a function with an empty parameter list. + `_ for examples, and the `JSON + Schema reference `_ for documentation about + the format. Omitting ``parameters`` defines a function with an empty parameter list. """ @@ -12387,6 +12427,10 @@ class HostedAgentDefinition( :ivar session_configuration: Optional session defaults (for example, the idle timeout) applied to sessions created for this agent version. :vartype session_configuration: ~azure.ai.projects.models.SessionConfiguration + :ivar enable_memory_snapshot: Whether this agent version uses memory snapshots. Sessions for a + snapshot-enabled version start from a snapshot of the agent's initialized process rather than + starting the process from its image. Defaults to false. + :vartype enable_memory_snapshot: bool """ kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -12423,6 +12467,10 @@ class HostedAgentDefinition( ) """Optional session defaults (for example, the idle timeout) applied to sessions created for this agent version.""" + enable_memory_snapshot: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version uses memory snapshots. Sessions for a snapshot-enabled version start + from a snapshot of the agent's initialized process rather than starting the process from its + image. Defaults to false.""" @overload def __init__( @@ -12437,6 +12485,7 @@ def __init__( code_configuration: Optional["_models.CodeConfiguration"] = None, telemetry_config: Optional["_models.TelemetryConfig"] = None, session_configuration: Optional["_models.SessionConfiguration"] = None, + enable_memory_snapshot: Optional[bool] = None, ) -> None: ... @overload @@ -12556,23 +12605,28 @@ class ImageGenTool( :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION :ivar model: Is one of the following types: Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], str - :vartype model: str or str or str or str or str or str - :ivar quality: The quality of the generated image. One of ``low``, ``medium``, ``high``, or - ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype quality: str or str or str or str - :ivar size: The size of the generated images. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` strings, - for example ``1536x864``. Width and height must both be divisible by 16 and the requested - aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are experimental, and - the maximum supported resolution is ``3840x2160``. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes ``1024x1024``, ``1536x1024``, and - ``1024x1536`` are supported by the GPT image models; ``auto`` is supported for models that - allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, or - ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is - one of the following types: Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], - Literal["auto"], str + Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str + :vartype model: str or str or str or str or str or str or str or str or str or str + :ivar quality: The quality of the generated image. The GPT image models support ``low``, + ``medium``, and ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one + of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"], + Literal["max"], Literal["auto"] + :vartype quality: str or str or str or str or str or str + :ivar size: The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, + or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. + Is one of the following types: Literal["1024x1024"], Literal["1024x1536"], + Literal["1536x1024"], Literal["auto"], str :vartype size: str or str or str or str or str :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], @@ -12584,10 +12638,12 @@ class ImageGenTool( Literal["auto"] type or a Literal["low"] type. :vartype moderation: str or str :ivar background: Set the background of the generated image. One of ``transparent``, - ``opaque``, or ``auto``. Transparent backgrounds are available for supported GPT Image models. - For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, this support is in preview. When using - ``transparent``, set the output format to ``png`` or ``webp``. Default: ``auto``. Is one of the - following types: Literal["transparent"], Literal["opaque"], Literal["auto"] + ``opaque``, or ``auto``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent + backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the + output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: + Literal["transparent"], Literal["opaque"], Literal["auto"] :vartype background: str or str or str :ivar input_fidelity: Known values are: "high" and "low". :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity @@ -12619,30 +12675,40 @@ class ImageGenTool( Literal["gpt-image-1.5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str, ] ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], - Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], str""" - quality: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], + Literal[\"gpt-image-2.5-sunburst\"], Literal[\"gpt-image-2.5-sunburst-2026-09-08\"], + Literal[\"gpt-image-2.5-flare\"], Literal[\"gpt-image-2.5-flare-2026-09-08\"], str""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The quality of the generated image. One of ``low``, ``medium``, ``high``, or ``auto``. Default: - ``auto``. Is one of the following types: Literal[\"low\"], Literal[\"medium\"], - Literal[\"high\"], Literal[\"auto\"]""" + """The quality of the generated image. The GPT image models support ``low``, ``medium``, and + ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their + ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one of the + following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"], + Literal[\"max\"], Literal[\"auto\"]""" size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """The size of the generated images. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, arbitrary - resolutions are supported as ``WIDTHxHEIGHT`` strings, for example ``1536x864``. Width and - height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. - Resolutions above ``2560x1440`` are experimental, and the maximum supported resolution is - ``3840x2160``. The requested size must also satisfy the model's current pixel and edge limits. - The standard sizes ``1024x1024``, ``1536x1024``, and ``1024x1536`` are supported by the GPT - image models; ``auto`` is supported for models that allow automatic sizing. For ``dall-e-2``, - use one of ``256x256``, ``512x512``, or ``1024x1024``. For ``dall-e-3``, use one of - ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is one of the following types: - Literal[\"1024x1024\"], Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" + """The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, + or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. + Is one of the following types: Literal[\"1024x1024\"], Literal[\"1024x1536\"], + Literal[\"1536x1024\"], Literal[\"auto\"], str""" output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12659,10 +12725,12 @@ class ImageGenTool( visibility=["read", "create", "update", "delete", "query"] ) """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. - Transparent backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the - output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: - Literal[\"transparent\"], Literal[\"opaque\"], Literal[\"auto\"]""" + ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their ``2026-09-08`` + snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent backgrounds are + available for supported GPT Image models. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, + this support is in preview. When using ``transparent``, set the output format to ``png`` or + ``webp``. Default: ``auto``. Is one of the following types: Literal[\"transparent\"], + Literal[\"opaque\"], Literal[\"auto\"]""" input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12699,10 +12767,14 @@ def __init__( Literal["gpt-image-1.5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str, ] ] = None, - quality: Optional[Literal["low", "medium", "high", "auto"]] = None, + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None, size: Optional[ Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] ] = None, @@ -13393,41 +13465,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RoutineActionType.INVOKE_AGENT_RESPONSES_API # type: ignore -class LocalShellToolParam( - Tool, discriminator="local_shell" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Local shell tool. +class LiveAllowedServerEventParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Live server event selector for the WebRTC frontend data channel. - :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The outer Live server event type. Use 'response.event' for Responses events. + Required. + :vartype type: str + :ivar response_event: The nested Responses event type. Required when type is 'response.event'; + forbidden for other event types. + :vartype response_event: str """ - type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The outer Live server event type. Use 'response.event' for Responses events. Required.""" + response_event: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The nested Responses event type. Required when type is 'response.event'; forbidden for other + event types.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + type: str, + response_event: Optional[str] = None, ) -> None: ... @overload @@ -13439,34 +13499,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.LOCAL_SHELL # type: ignore -class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LocalSkillParam. +class LiveAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. + WebRTC and SIP negotiate their media format separately. - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: The description of the skill. Required. - :vartype description: str - :ivar path: The path to the directory containing the skill. Required. - :vartype path: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveSessionAudioFormatPCMParam, LiveSessionAudioFormatPCMAParam, + LiveSessionAudioFormatPCMUParam + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.LiveAudioFormatType """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the skill. Required.""" - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path to the directory containing the skill. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" @overload def __init__( self, *, - name: str, - description: str, - path: str, + type: str, ) -> None: ... @overload @@ -13480,31 +13535,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A log probability object. +class LiveClientConfigParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected. - :ivar token: The token that was used to generate the log probability. Required. - :vartype token: str - :ivar logprob: The log probability of the token. Required. - :vartype logprob: float - :ivar bytes: The bytes that were used to generate the log probability. Required. - :vartype bytes: list[int] + :ivar data_channel: Client and server event permissions for the WebRTC frontend data channel. + Required. + :vartype data_channel: ~azure.ai.projects.models.LiveDataChannelConfigParam """ - token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The token that was used to generate the log probability. Required.""" - logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The log probability of the token. Required.""" - bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The bytes that were used to generate the log probability. Required.""" + data_channel: "_models.LiveDataChannelConfigParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Client and server event permissions for the WebRTC frontend data channel. Required.""" @overload def __init__( self, *, - token: str, - logprob: float, - bytes: list[int], + data_channel: "_models.LiveDataChannelConfigParam", ) -> None: ... @overload @@ -13518,41 +13567,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment - time. +class LiveClientDelegationParam(Delegation, discriminator="client"): + """Delegate tasks to your application. The Live session emits delegation events that your backend + handles. - :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. - :vartype rank: int - :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. - :vartype alpha: int - :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). - Auto-detected from adapter_config.json if omitted. - :vartype target_modules: list[str] - :ivar dropout: Dropout rate used during training. Informational — not used at serving time. - :vartype dropout: float + :ivar type: The delegation owner. Always ``client`` for tasks handled by your application. + Required. CLIENT. + :vartype type: str or ~azure.ai.projects.models.CLIENT """ - rank: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" - alpha: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" - target_modules: Optional[list[str]] = rest_field( - name="targetModules", visibility=["read", "create", "update", "delete", "query"] - ) - """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from - adapter_config.json if omitted.""" - dropout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dropout rate used during training. Informational — not used at serving time.""" + type: Literal[DelegationType.CLIENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The delegation owner. Always ``client`` for tasks handled by your application. Required. + CLIENT.""" @overload def __init__( self, - *, - rank: Optional[int] = None, - alpha: Optional[int] = None, - target_modules: Optional[list[str]] = None, - dropout: Optional[float] = None, ) -> None: ... @overload @@ -13564,29 +13594,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DelegationType.CLIENT # type: ignore -class ManagedAgentIdentityBlueprintReference( - AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """ManagedAgentIdentityBlueprintReference. +class LiveClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Client events for Live. Initialize a primary WebSocket with session.start and wait for + session.started. WebRTC creation already starts the session. Audio append is primary + WebSocket-only. See the `Live prompting guide + `_ before writing frontend + instructions and delegation policies. - :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. - :vartype type: str or ~azure.ai.projects.models.MANAGED_AGENT_IDENTITY_BLUEPRINT - :ivar blueprint_id: The ID of the managed blueprint. Required. - :vartype blueprint_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveClientEventLiveResponseCreateParam, LiveClientEventLiveResponseItemCreateParam, + LiveClientEventLiveSessionCloseParam, LiveClientEventLiveCommentaryAppendParam, + LiveClientEventLiveInputAudioAppendEvent, LiveClientEventLiveInputAudioMuteParam, + LiveClientEventLiveInputAudioUnmuteParam, LiveClientEventLiveInstructionsAppendParam, + LiveSessionStartEvent, LiveClientEventLiveThinkingAppendParam, + LiveClientEventLiveSessionUpdateParam + + :ivar type: Required. Known values are: "session.start", "session.update", + "session.input_audio.append", "session.input_audio.mute", "session.input_audio.unmute", + "session.instructions.append", "session.thinking.append", "session.commentary.append", + "response.item.create", "response.create", and "session.close". + :vartype type: str or ~azure.ai.projects.models.LiveClientEventType """ - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" - blueprint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the managed blueprint. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"session.start\", \"session.update\", + \"session.input_audio.append\", \"session.input_audio.mute\", \"session.input_audio.unmute\", + \"session.instructions.append\", \"session.thinking.append\", \"session.commentary.append\", + \"response.item.create\", \"response.create\", and \"session.close\".""" @overload def __init__( self, *, - blueprint_id: str, + type: str, ) -> None: ... @overload @@ -13598,42 +13642,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore -class ManagedAzureAISearchIndex( - Index, discriminator="ManagedAzureSearch" +class LiveClientEventLiveCommentaryAppendParam( + LiveClientEvent, discriminator="session.commentary.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed Azure AI Search Index Definition. + """Provide context the Live model can communicate to the user, optionally for an existing client + delegation. - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar type: Type of index. Required. Managed Azure Search. - :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH - :ivar vector_store_id: Vector store id of managed index. Required. - :vartype vector_store_id: str + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.commentary.append``. Required. + SESSION_COMMENTARY_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_COMMENTARY_APPEND + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar content: Speakable context for the Live model, limited to 500 tokens. Use this for a + result the model should communicate; use session.thinking.append for silent context. Required. + :vartype content: str """ - type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Managed Azure Search.""" - vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) - """Vector store id of managed index. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_COMMENTARY_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.commentary.append``. Required. + SESSION_COMMENTARY_APPEND.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Speakable context for the Live model, limited to 500 tokens. Use this for a result the model + should communicate; use session.thinking.append for silent context. Required.""" @overload def __init__( self, *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + delegation_id: str, + content: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -13645,41 +13690,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore + self.type = LiveClientEventType.SESSION_COMMENTARY_APPEND # type: ignore -class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP list tools tool. +class LiveClientEventLiveInputAudioAppendEvent( + LiveClientEvent, discriminator="session.input_audio.append" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Send audio to a Live session over its primary WebSocket. WebRTC and SIP sessions send audio + over their media transport. - :ivar name: The name of the tool. Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar input_schema: The JSON schema describing the tool's input. Required. - :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema - :ivar annotations: - :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_APPEND + :ivar audio: Base64-encoded raw audio in the startup-selected format, without a WAV or other + container header. Primary WebSocket only; media transports use their audio track. Audio appends + have no acknowledgment. Reflected sideband server events reuse this event type and audio key, + with no timestamps or event_id; their audio is always mono PCM16LE at 24 kHz. Required. + :vartype audio: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The JSON schema describing the tool's input. Required.""" - annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw audio in the startup-selected format, without a WAV or other container + header. Primary WebSocket only; media transports use their audio track. Audio appends have no + acknowledgment. Reflected sideband server events reuse this event type and audio key, with no + timestamps or event_id; their audio is always mono PCM16LE at 24 kHz. Required.""" @overload def __init__( self, *, - name: str, - input_schema: "_models.MCPListToolsToolInputSchema", - description: Optional[str] = None, - annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -13691,34 +13738,3416 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INPUT_AUDIO_APPEND # type: ignore -class MCPListToolsToolAnnotations(_Model): - """MCPListToolsToolAnnotations.""" +class LiveClientEventLiveInputAudioMuteParam( + LiveClientEvent, discriminator="session.input_audio.mute" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Mute audio input to the Live model without closing the session. The server acknowledges with + ``session.input_audio.muted``. + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.input_audio.mute``. Required. + SESSION_INPUT_AUDIO_MUTE. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_MUTE + """ -class MCPListToolsToolInputSchema(_Model): - """MCPListToolsToolInputSchema.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_MUTE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.input_audio.mute``. Required. + SESSION_INPUT_AUDIO_MUTE.""" + @overload + def __init__( + self, + *, + event_id: Optional[str] = None, + ) -> None: ... -class McpProtocolConfiguration(_Model): - """Configuration specific to the MCP protocol.""" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INPUT_AUDIO_MUTE # type: ignore -class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or - ``tunnel_id`` must be provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here `_. Currently supported - ``connector_id`` values are: +class LiveClientEventLiveInputAudioUnmuteParam( + LiveClientEvent, discriminator="session.input_audio.unmute" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Resume audio input to a Live model after muting it. The server acknowledges with + ``session.input_audio.unmuted``. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.input_audio.unmute``. Required. + SESSION_INPUT_AUDIO_UNMUTE. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_UNMUTE + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INPUT_AUDIO_UNMUTE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.input_audio.unmute``. Required. + SESSION_INPUT_AUDIO_UNMUTE.""" + + @overload + def __init__( + self, + *, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INPUT_AUDIO_UNMUTE # type: ignore + + +class LiveClientEventLiveInstructionsAppendParam( + LiveClientEvent, discriminator="session.instructions.append" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Append instructions to the Live conversation while it is running, optionally associating them + with an existing client delegation. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.instructions.append``. Required. + SESSION_INSTRUCTIONS_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INSTRUCTIONS_APPEND + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar content: Instruction text to append, limited to 500 tokens. This is a plain string, not + an array of content parts. Required. + :vartype content: str + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_INSTRUCTIONS_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.instructions.append``. Required. + SESSION_INSTRUCTIONS_APPEND.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instruction text to append, limited to 500 tokens. This is a plain string, not an array of + content parts. Required.""" + + @overload + def __init__( + self, + *, + delegation_id: str, + content: str, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_INSTRUCTIONS_APPEND # type: ignore + + +class LiveClientEventLiveResponseCreateParam( + LiveClientEvent, discriminator="response.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request a response from the Live session’s Responses backend, or continue a delegated response + waiting for tool results. Requires Responses delegation. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``response.create``. Required. RESPONSE_CREATE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATE + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``response.create``. Required. RESPONSE_CREATE.""" + + @overload + def __init__( + self, + *, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.RESPONSE_CREATE # type: ignore + + +class LiveClientEventLiveResponseItemCreateParam( + LiveClientEvent, discriminator="response.item.create" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Add an input item to the Live session’s Responses backend. Requires Responses delegation; use + ``response.create`` to request a response. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``response.item.create``. Required. + RESPONSE_ITEM_CREATE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_ITEM_CREATE + :ivar item: An input item to append to the Responses backend conversation, such as a user + message or a function tool result. Required. + :vartype item: dict[str, any] + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.RESPONSE_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``response.item.create``. Required. RESPONSE_ITEM_CREATE.""" + item: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An input item to append to the Responses backend conversation, such as a user message or a + function tool result. Required.""" + + @overload + def __init__( + self, + *, + item: dict[str, Any], + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.RESPONSE_ITEM_CREATE # type: ignore + + +class LiveClientEventLiveSessionCloseParam( + LiveClientEvent, discriminator="session.close" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request that the Live session close. The terminal ``session.closed`` event contains the close + reason and final usage. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.close``. Required. SESSION_CLOSE. + :vartype type: str or ~azure.ai.projects.models.SESSION_CLOSE + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_CLOSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.close``. Required. SESSION_CLOSE.""" + + @overload + def __init__( + self, + *, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_CLOSE # type: ignore + + +class LiveClientEventLiveSessionUpdateParam( + LiveClientEvent, discriminator="session.update" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Update the delegation settings of an active Live session. The server acknowledges accepted + changes with ``session.updated``. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.update``. Required. SESSION_UPDATE. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE + :ivar session: Sparse delegation updates. Omitted settings retain their values. The delegation + type cannot change, including resetting Responses delegation to null or client. Model, frontend + instructions, audio, and startup input are immutable. Required. + :vartype session: ~azure.ai.projects.models.LiveSessionUpdateParams + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_UPDATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.update``. Required. SESSION_UPDATE.""" + session: "_models.LiveSessionUpdateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sparse delegation updates. Omitted settings retain their values. The delegation type cannot + change, including resetting Responses delegation to null or client. Model, frontend + instructions, audio, and startup input are immutable. Required.""" + + @overload + def __init__( + self, + *, + session: "_models.LiveSessionUpdateParams", + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_UPDATE # type: ignore + + +class LiveClientEventLiveThinkingAppendParam( + LiveClientEvent, discriminator="session.thinking.append" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Provide silent reasoning or progress context to the Live model, optionally for an existing + client delegation. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.thinking.append``. Required. + SESSION_THINKING_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_THINKING_APPEND + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar content: Silent reasoning or progress context, limited to 500 tokens. It does not + directly request speech, but can influence later speech and is not a secrecy boundary. + Required. + :vartype content: str + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_THINKING_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.thinking.append``. Required. + SESSION_THINKING_APPEND.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Silent reasoning or progress context, limited to 500 tokens. It does not directly request + speech, but can influence later speech and is not a secrecy boundary. Required.""" + + @overload + def __init__( + self, + *, + delegation_id: str, + content: str, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_THINKING_APPEND # type: ignore + + +class LiveContextWindowUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The latest measured context-window usage of the Live model. This is separate from billing usage + and delegated Responses token usage. + + :ivar usage_ratio: The latest active context token count divided by the Live model context + limit. Can decrease after compaction and may lag between measured audio frames. Required. + :vartype usage_ratio: float + """ + + usage_ratio: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latest active context token count divided by the Live model context limit. Can decrease + after compaction and may lag between measured audio frames. Required.""" + + @overload + def __init__( + self, + *, + usage_ratio: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveCustomVoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveCustomVoiceParam. + + :ivar id: Required. + :vartype id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveDataChannelConfigParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Control which Live events an untrusted WebRTC frontend can send and receive over its data + channel. These restrictions do not apply to trusted sideband connections. + + :ivar allowed_client_events: Client event types that the frontend data channel may send. Use + 'all' to allow every client event; an empty array allows none. Omission preserves the existing + allow-all behavior. Is either a Literal["all"] type or a [str] type. + :vartype allowed_client_events: str or list[str] + :ivar allowed_server_events: Server events that may be sent to the frontend data channel. Use + 'all' to allow every server event; an empty array allows none. Omission preserves the existing + allow-all behavior. Responses events use an object with type 'response.event' and a + response_event selector. Is either a Literal["all"] type or a [LiveAllowedServerEventParam] + type. + :vartype allowed_server_events: str or + list[~azure.ai.projects.models.LiveAllowedServerEventParam] + """ + + allowed_client_events: Optional[Union[Literal["all"], list[str]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Client event types that the frontend data channel may send. Use 'all' to allow every client + event; an empty array allows none. Omission preserves the existing allow-all behavior. Is + either a Literal[\"all\"] type or a [str] type.""" + allowed_server_events: Optional[Union[Literal["all"], list["_models.LiveAllowedServerEventParam"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Server events that may be sent to the frontend data channel. Use 'all' to allow every server + event; an empty array allows none. Omission preserves the existing allow-all behavior. + Responses events use an object with type 'response.event' and a response_event selector. Is + either a Literal[\"all\"] type or a [LiveAllowedServerEventParam] type.""" + + @overload + def __init__( + self, + *, + allowed_client_events: Optional[Union[Literal["all"], list[str]]] = None, + allowed_server_events: Optional[Union[Literal["all"], list["_models.LiveAllowedServerEventParam"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveDelegationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata for work delegated by the Live model. Client delegations are handled by your + application; Responses delegations run on the configured backend. + + :ivar id: The unique ID of the delegation. Use this as delegation_id when replying to + client-owned work or correlating Responses events. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. Default value is "delegation". + :vartype type: str + :ivar target: Where the Live model delegated the work: ``client`` for your application, or + ``responses`` for the configured Responses backend. Required. Is either a Literal["client"] + type or a Literal["responses"] type. + :vartype target: str or str + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the delegation. Use this as delegation_id when replying to client-owned work + or correlating Responses events. Required.""" + type: Literal["delegation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type, always ``delegation``. Required. Default value is \"delegation\".""" + target: Literal["client", "responses"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Where the Live model delegated the work: ``client`` for your application, or ``responses`` for + the configured Responses backend. Required. Is either a Literal[\"client\"] type or a + Literal[\"responses\"] type.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Responses API response associated with a Responses delegation. Omitted for client + delegations.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + target: Literal["client", "responses"], + response_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["delegation"] = "delegation" + + +class LiveDelegationReasoningInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning options for Responses requests made on behalf of the Live session. + + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.LiveReasoningEffort + :ivar summary: Known values are: "concise", "detailed", and "auto". + :vartype summary: str or ~azure.ai.projects.models.LiveReasoningSummary + """ + + effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"concise\", \"detailed\", and \"auto\".""" + + @overload + def __init__( + self, + *, + effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = None, + summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveDelegationTextInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Text generation options for the Live session’s Responses backend. + + :ivar verbosity: Known values are: "low", "medium", and "high". + :vartype verbosity: str or ~azure.ai.projects.models.LiveTextVerbosity + """ + + verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"low\", \"medium\", and \"high\".""" + + @overload + def __init__( + self, + *, + verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveFunctionToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveFunctionToolChoiceParam. + + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar name: Required. + :vartype name: str + """ + + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["function"] = "function" + + +class LiveFunctionToolInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function tool available to the Responses backend when the Live model delegates a task. + + :ivar type: The tool type. Always ``function``. Required. Default value is "function". + :vartype type: str + :ivar name: The name the delegated Responses model uses when calling this function. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: dict[str, any] + :ivar strict: + :vartype strict: bool + """ + + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool type. Always ``function``. Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name the delegated Responses model uses when calling this function. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + name: str, + description: Optional[str] = None, + parameters: Optional[dict[str, Any]] = None, + strict: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["function"] = "function" + + +class LiveInitialItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A developer, user, or assistant message supplied as text history before the Live session + starts. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveInitialAssistantMessageItemParam, LiveInitialDeveloperMessageItemParam, + LiveInitialUserMessageItemParam + + :ivar role: Required. Known values are: "developer", "user", and "assistant". + :vartype role: str or ~azure.ai.projects.models.LiveInitialItemType + """ + + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"developer\", \"user\", and \"assistant\".""" + + @overload + def __init__( + self, + *, + role: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveInitialAssistantMessageItemParam( + LiveInitialItem, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An assistant message included in the initial text history of a Live session. + + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``assistant``. Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialTextContentPartParam or + ~azure.ai.projects.models.LiveInitialOutputTextContentPartParam] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``assistant``. Required. ASSISTANT.""" + content: list[Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" + + @overload + def __init__( + self, + *, + content: list[ + Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"] + ], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.ASSISTANT # type: ignore + + +class LiveInitialDeveloperMessageItemParam( + LiveInitialItem, discriminator="developer" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A developer message included in the initial text history of a Live session. + + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``developer``. Required. DEVELOPER. + :vartype role: str or ~azure.ai.projects.models.DEVELOPER + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.DEVELOPER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``developer``. Required. DEVELOPER.""" + content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" + + @overload + def __init__( + self, + *, + content: list["_models.LiveInitialInputTextContentPartParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.DEVELOPER # type: ignore + + +class LiveInitialInputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Text supplied in a developer or user message when starting a Live session. + + :ivar type: The text content type. Always ``input_text``. Default value is "input_text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str + """ + + type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``input_text``. Default value is \"input_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" + + @overload + def __init__( + self, + *, + text: str, + type: Optional[Literal["input_text"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveInitialOutputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Assistant output text supplied as conversation history when starting a Live session. + + :ivar type: The text content type. Always ``output_text``. Required. Default value is + "output_text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str + """ + + type: Literal["output_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``output_text``. Required. Default value is \"output_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" + + @overload + def __init__( + self, + *, + text: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["output_text"] = "output_text" + + +class LiveInitialSessionAudioOutputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Settings for speech generated by the Live model. Choose the voice before starting the session. + + :ivar voice: The voice used for Live speech, as a built-in voice name or a custom voice object + containing its ID. Defaults to ``marin`` and cannot change after startup. Is one of the + following types: str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], + Literal["bossa"], Literal["cedar"], Literal["cinder"], Literal["coral"], Literal["delta"], + Literal["echo"], Literal["gleam"], Literal["marin"], Literal["meridian"], Literal["quartz"], + Literal["ripple"], Literal["sage"], Literal["shimmer"], Literal["stone"], Literal["tempo"], + Literal["verse"], Literal["vesper"], Literal["willow"], LiveCustomVoiceParam + :vartype voice: str or str or str or str or str or str or str or str or str or str or str or + str or str or str or str or str or str or str or str or str or str or str or str or + ~azure.ai.projects.models.LiveCustomVoiceParam + """ + + voice: Optional[ + Union[ + str, + Literal["alloy"], + Literal["ash"], + Literal["ballad"], + Literal["beacon"], + Literal["bossa"], + Literal["cedar"], + Literal["cinder"], + Literal["coral"], + Literal["delta"], + Literal["echo"], + Literal["gleam"], + Literal["marin"], + Literal["meridian"], + Literal["quartz"], + Literal["ripple"], + Literal["sage"], + Literal["shimmer"], + Literal["stone"], + Literal["tempo"], + Literal["verse"], + Literal["vesper"], + Literal["willow"], + "_models.LiveCustomVoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice used for Live speech, as a built-in voice name or a custom voice object containing + its ID. Defaults to ``marin`` and cannot change after startup. Is one of the following types: + str, Literal[\"alloy\"], Literal[\"ash\"], Literal[\"ballad\"], Literal[\"beacon\"], + Literal[\"bossa\"], Literal[\"cedar\"], Literal[\"cinder\"], Literal[\"coral\"], + Literal[\"delta\"], Literal[\"echo\"], Literal[\"gleam\"], Literal[\"marin\"], + Literal[\"meridian\"], Literal[\"quartz\"], Literal[\"ripple\"], Literal[\"sage\"], + Literal[\"shimmer\"], Literal[\"stone\"], Literal[\"tempo\"], Literal[\"verse\"], + Literal[\"vesper\"], Literal[\"willow\"], LiveCustomVoiceParam""" + + @overload + def __init__( + self, + *, + voice: Optional[ + Union[ + str, + Literal["alloy"], + Literal["ash"], + Literal["ballad"], + Literal["beacon"], + Literal["bossa"], + Literal["cedar"], + Literal["cinder"], + Literal["coral"], + Literal["delta"], + Literal["echo"], + Literal["gleam"], + Literal["marin"], + Literal["meridian"], + Literal["quartz"], + Literal["ripple"], + Literal["sage"], + Literal["shimmer"], + Literal["stone"], + Literal["tempo"], + Literal["verse"], + Literal["vesper"], + Literal["willow"], + "_models.LiveCustomVoiceParam", + ] + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveInitialSessionAudioParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup. + + :ivar format: Audio encoding and sample rate for audio sent and received over a Live WebSocket + connection. WebRTC and SIP negotiate their media format separately. + :vartype format: ~azure.ai.projects.models.LiveAudioFormat + :ivar output: The voice used for speech generated by the Live model. + :vartype output: ~azure.ai.projects.models.LiveInitialSessionAudioOutputParam + """ + + format: Optional["_models.LiveAudioFormat"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. + WebRTC and SIP negotiate their media format separately.""" + output: Optional["_models.LiveInitialSessionAudioOutputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The voice used for speech generated by the Live model.""" + + @overload + def __init__( + self, + *, + format: Optional["_models.LiveAudioFormat"] = None, + output: Optional["_models.LiveInitialSessionAudioOutputParam"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveInitialTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Assistant text supplied as conversation history when starting a Live session. + + :ivar type: The text content type. Always ``text``. Default value is "text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str + """ + + type: Optional[Literal["text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``text``. Default value is \"text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" + + @overload + def __init__( + self, + *, + text: str, + type: Optional[Literal["text"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveInitialUserMessageItemParam( + LiveInitialItem, discriminator="user" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A user message included in the initial text history of a Live session. + + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``user``. Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``user``. Required. USER.""" + content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" + + @overload + def __init__( + self, + *, + content: list["_models.LiveInitialInputTextContentPartParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.USER # type: ignore + + +class LiveServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An event sent by the Live API on a primary WebSocket or sideband connection. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveServerEventLiveErrorEvent, LiveServerEventLiveInfoEvent, LiveServerEventLiveResponseEvent, + LiveServerEventLiveSessionClosed, LiveServerEventLiveCommentaryAppended, + LiveServerEventLiveDelegationCreated, LiveInputAudioAppend, LiveServerEventLiveInputAudioMuted, + LiveServerEventLiveInputAudioUnmuted, LiveServerEventLiveInputTranscriptDelta, + LiveServerEventLiveInstructionsAppended, LiveOutputAudioDelta, + LiveServerEventLiveOutputTranscriptDelta, LiveServerEventLiveSessionStarted, + LiveServerEventLiveThinkingAppended, LiveServerEventLiveSessionUpdated, + LiveServerEventLiveSessionUsageUpdated, LiveTransportAnswered, LiveTransportDTMFReceived, + LiveTransportDTMFSend, LiveTransportFailed, LiveTransportRinging + + :ivar type: Required. Known values are: "session.started", "session.updated", + "session.input_audio.muted", "session.input_audio.unmuted", "session.instructions.appended", + "session.thinking.appended", "session.commentary.appended", "session.input_audio.append", + "session.output_audio.delta", "session.input_transcript.delta", + "session.output_transcript.delta", "session.delegation.created", "response.event", + "session.usage.updated", "session.closed", "error", "info", "transport.dtmf.received", + "transport.dtmf.send", "transport.ringing", "transport.answered", and "transport.failed". + :vartype type: str or ~azure.ai.projects.models.LiveServerEventType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"session.started\", \"session.updated\", + \"session.input_audio.muted\", \"session.input_audio.unmuted\", + \"session.instructions.appended\", \"session.thinking.appended\", + \"session.commentary.appended\", \"session.input_audio.append\", + \"session.output_audio.delta\", \"session.input_transcript.delta\", + \"session.output_transcript.delta\", \"session.delegation.created\", \"response.event\", + \"session.usage.updated\", \"session.closed\", \"error\", \"info\", + \"transport.dtmf.received\", \"transport.dtmf.send\", \"transport.ringing\", + \"transport.answered\", and \"transport.failed\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveInputAudioAppend( + LiveServerEvent, discriminator="session.input_audio.append" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio received from the primary transport and reflected to a Live sideband connection + before model-input muting. + + :ivar type: The event type, always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_APPEND + :ivar audio: Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, + reflected to the sideband before model-input muting. This server event uses the same audio key + as the client command, but is not an acknowledgment of it. Required. + :vartype audio: str + """ + + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.append``. Required. SESSION_INPUT_AUDIO_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, reflected to the + sideband before model-input muting. This server event uses the same audio key as the client + command, but is not an acknowledgment of it. Required.""" + + @overload + def __init__( + self, + *, + audio: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_APPEND # type: ignore + + +class LiveLiveError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of an error encountered by the Live session, including the affected parameter or client + command when available. + + :ivar type: The category of error, such as ``invalid_request_error`` for an invalid Live client + command. Required. + :vartype type: str + :ivar code: A machine-readable code identifying the Live error, such as ``unknown_parameter``. + Required. + :vartype code: str + :ivar message: A human-readable explanation of the Live error. Required. + :vartype message: str + :ivar param: The parameter that caused the error, when applicable, such as ``session.voice``. + :vartype param: str + :ivar client_event_id: The event_id of the client command that caused the error, when supplied. + :vartype client_event_id: str + """ + + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The category of error, such as ``invalid_request_error`` for an invalid Live client command. + Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable code identifying the Live error, such as ``unknown_parameter``. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable explanation of the Live error. Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameter that caused the error, when applicable, such as ``session.voice``.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command that caused the error, when supplied.""" + + @overload + def __init__( + self, + *, + type: str, + code: str, + message: str, + param: Optional[str] = None, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveMCPToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveMCPToolChoiceParam. + + :ivar type: Required. Default value is "mcp". + :vartype type: str + :ivar server_label: Required. + :vartype server_label: str + :ivar name: Required. + :vartype name: str + """ + + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"mcp\".""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + server_label: str, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["mcp"] = "mcp" + + +class LiveOutputAudioDelta( + LiveServerEvent, discriminator="session.output_audio.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in + delivery order using the configured session audio format. Sideband connections receive + reflected output audio with timestamps. + + :ivar type: The event type, always ``session.output_audio.delta``. Required. + SESSION_OUTPUT_AUDIO_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_DELTA + :ivar delta: Base64-encoded raw audio. Primary WebSocket events use the session's configured + format; reflected sideband events use mono PCM16LE at 24 kHz. Required. + :vartype delta: str + :ivar start_ms: Inclusive session-relative start in milliseconds. Required on reflected + sideband events; omitted on the primary WebSocket. + :vartype start_ms: int + :ivar end_ms: Exclusive session-relative end in milliseconds. Required on reflected sideband + events; omitted on the primary WebSocket. Dropped output frames leave gaps between reflected + ranges. + :vartype end_ms: int + """ + + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.output_audio.delta``. Required. SESSION_OUTPUT_AUDIO_DELTA.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw audio. Primary WebSocket events use the session's configured format; + reflected sideband events use mono PCM16LE at 24 kHz. Required.""" + start_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inclusive session-relative start in milliseconds. Required on reflected sideband events; + omitted on the primary WebSocket.""" + end_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Exclusive session-relative end in milliseconds. Required on reflected sideband events; omitted + on the primary WebSocket. Dropped output frames leave gaps between reflected ranges.""" + + @overload + def __init__( + self, + *, + delta: str, + start_ms: Optional[int] = None, + end_ms: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA # type: ignore + + +class LiveResponsesDelegationParam( + Delegation, discriminator="responses" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Delegate tasks to a Responses model managed by the Live session. + + :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. + Required. RESPONSES. + :vartype type: str or ~azure.ai.projects.models.RESPONSES + :ivar responses: Backend model, prompt, and tools used when the Live session delegates a task + to Responses. Required. + :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam + """ + + type: Literal[DelegationType.RESPONSES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. + RESPONSES.""" + responses: "_models.LiveResponsesDelegationSettingsInputParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Backend model, prompt, and tools used when the Live session delegates a task to Responses. + Required.""" + + @overload + def __init__( + self, + *, + responses: "_models.LiveResponsesDelegationSettingsInputParam", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = DelegationType.RESPONSES # type: ignore + + +class LiveResponsesDelegationSettingsInputParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Model, prompt, and tool settings for tasks delegated by the Live session to a Responses + backend. + + :ivar model: The model used for server-owned Responses delegations. Required. + :vartype model: str + :ivar instructions: + :vartype instructions: str + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", + "priority", and "ultrafast". + :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam + :ivar text: + :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam + :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the + Live model. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or + ~azure.ai.projects.models.LiveWebSearchToolInputParam] + :ivar tool_choice: Controls which tool the Responses backend uses when handling a task + delegated by the Live model. Is one of the following types: Union[str, + "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam + :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or + ~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam + :ivar parallel_tool_calls: + :vartype parallel_tool_calls: bool + """ + + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used for server-owned Responses delegations. Required.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and + \"ultrafast\".""" + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + tools: Optional[list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" + tool_choice: Optional[ + Union[ + str, "_models.LiveToolChoiceEnum", "_models.LiveFunctionToolChoiceParam", "_models.LiveMCPToolChoiceParam" + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Controls which tool the Responses backend uses when handling a task delegated by the Live + model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], + LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + model: str, + instructions: Optional[str] = None, + max_output_tokens: Optional[int] = None, + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, + text: Optional["_models.LiveDelegationTextInputParam"] = None, + tools: Optional[ + list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]] + ] = None, + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + ] + ] = None, + parallel_tool_calls: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveResponsesDelegationSettingsUpdateInputParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Updates to the Responses backend of an existing Live session. Omitted settings retain their + current values. + + :ivar model: The Responses backend model to use for subsequent delegated requests. Omit to keep + the current backend model. + :vartype model: str + :ivar instructions: + :vartype instructions: str + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", + "priority", and "ultrafast". + :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam + :ivar text: + :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam + :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the + Live model. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or + ~azure.ai.projects.models.LiveWebSearchToolInputParam] + :ivar tool_choice: Controls which tool the Responses backend uses when handling a task + delegated by the Live model. Is one of the following types: Union[str, + "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam + :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or + ~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam + :ivar parallel_tool_calls: + :vartype parallel_tool_calls: bool + """ + + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Responses backend model to use for subsequent delegated requests. Omit to keep the current + backend model.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and + \"ultrafast\".""" + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + tools: Optional[list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" + tool_choice: Optional[ + Union[ + str, "_models.LiveToolChoiceEnum", "_models.LiveFunctionToolChoiceParam", "_models.LiveMCPToolChoiceParam" + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Controls which tool the Responses backend uses when handling a task delegated by the Live + model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], + LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_output_tokens: Optional[int] = None, + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, + text: Optional["_models.LiveDelegationTextInputParam"] = None, + tools: Optional[ + list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]] + ] = None, + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + ] + ] = None, + parallel_tool_calls: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveResponsesDelegationUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Update the Responses backend for an existing Live session without changing delegation + ownership. + + :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. + Required. Default value is "responses". + :vartype type: str + :ivar responses: Responses backend settings to update. Omitted settings keep their existing + values. + :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam + """ + + type: Literal["responses"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. + Default value is \"responses\".""" + responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Responses backend settings to update. Omitted settings keep their existing values.""" + + @overload + def __init__( + self, + *, + responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["responses"] = "responses" + + +class LiveServerEventLiveCommentaryAppended( + LiveServerEvent, discriminator="session.commentary.appended" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.commentary.append command is accepted into the Live session timeline. + Acknowledges the added commentary without guaranteeing exact wording or completed audio + playback. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.commentary.appended``. Required. + SESSION_COMMENTARY_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_COMMENTARY_APPENDED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_COMMENTARY_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.commentary.appended``. Required. SESSION_COMMENTARY_APPENDED.""" + + @overload + def __init__( + self, + *, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_COMMENTARY_APPENDED # type: ignore + + +class LiveServerEventLiveDelegationCreated( + LiveServerEvent, discriminator="session.delegation.created" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the Live model delegates work to your application or a Responses backend. + Contains delegation metadata and the position on the session timeline where the work was + delegated. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.delegation.created``. Required. + SESSION_DELEGATION_CREATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_DELEGATION_CREATED + :ivar offset_ms: The position on the Live session timeline where the delegation was created, in + milliseconds from the beginning of the session. Required. + :vartype offset_ms: int + :ivar delegation: The delegated work identifier and destination. This object contains metadata, + not the task text. Required. + :vartype delegation: ~azure.ai.projects.models.LiveDelegationItem + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.delegation.created``. Required. SESSION_DELEGATION_CREATED.""" + offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The position on the Live session timeline where the delegation was created, in milliseconds + from the beginning of the session. Required.""" + delegation: "_models.LiveDelegationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The delegated work identifier and destination. This object contains metadata, not the task + text. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + offset_ms: int, + delegation: "_models.LiveDelegationItem", + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_DELEGATION_CREATED # type: ignore + + +class LiveServerEventLiveErrorEvent( + LiveServerEvent, discriminator="error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reports an error in the Live session, such as an invalid client command. Use + error.client_event_id, when present, to identify the command that caused the error. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``error``. Required. ERROR. + :vartype type: str or ~azure.ai.projects.models.ERROR + :ivar error: Details of the Live error and the client command that caused it, when known. + Required. + :vartype error: ~azure.ai.projects.models.LiveLiveError + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``error``. Required. ERROR.""" + error: "_models.LiveLiveError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of the Live error and the client command that caused it, when known. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + error: "_models.LiveLiveError", + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.ERROR # type: ignore + + +class LiveServerEventLiveInfoEvent( + LiveServerEvent, discriminator="info" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An informational notice about the Live session, such as the event permissions applied to a + frontend data channel. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``info``. Required. INFO. + :vartype type: str or ~azure.ai.projects.models.INFO + :ivar code: A machine-readable code for the notice, such as ``data_channel_permissions``. + Required. + :vartype code: str + :ivar message: A human-readable explanation of the Live session notice. Required. + :vartype message: str + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.INFO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``info``. Required. INFO.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable code for the notice, such as ``data_channel_permissions``. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable explanation of the Live session notice. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + code: str, + message: str, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.INFO # type: ignore + + +class LiveServerEventLiveInputAudioMuted( + LiveServerEvent, discriminator="session.input_audio.muted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.input_audio.mute command is accepted. Input audio is no longer sent to + the model; sideband audio reflection continues. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.input_audio.muted``. Required. + SESSION_INPUT_AUDIO_MUTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_MUTED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_MUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.muted``. Required. SESSION_INPUT_AUDIO_MUTED.""" + + @overload + def __init__( + self, + *, + event_id: str, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_MUTED # type: ignore + + +class LiveServerEventLiveInputAudioUnmuted( + LiveServerEvent, discriminator="session.input_audio.unmuted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.input_audio.unmute command is accepted. Input audio is sent to the + model again. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.input_audio.unmuted``. Required. + SESSION_INPUT_AUDIO_UNMUTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_UNMUTED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.unmuted``. Required. SESSION_INPUT_AUDIO_UNMUTED.""" + + @overload + def __init__( + self, + *, + event_id: str, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED # type: ignore + + +class LiveServerEventLiveInputTranscriptDelta( + LiveServerEvent, discriminator="session.input_transcript.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcript fragment for user input audio in the Live session. Accumulate fragments in + delivery order; these events do not define complete turns or include a transcript-done event. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in + delivery order to build the transcript. Required. + :vartype delta: str + :ivar type: The event type, always ``session.input_transcript.delta``. Required. + SESSION_INPUT_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_TRANSCRIPT_DELTA + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript text fragment for the audio in this time range. Append fragments in delivery + order to build the transcript. Required.""" + type: Literal[LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_transcript.delta``. Required. + SESSION_INPUT_TRANSCRIPT_DELTA.""" + + @overload + def __init__( + self, + *, + event_id: str, + start_ms: int, + end_ms: int, + delta: str, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA # type: ignore + + +class LiveServerEventLiveInstructionsAppended( + LiveServerEvent, discriminator="session.instructions.appended" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.instructions.append command is accepted into the Live session timeline. + Acknowledges the appended instructions without guaranteeing that the model has acted on them. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.instructions.appended``. Required. + SESSION_INSTRUCTIONS_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INSTRUCTIONS_APPENDED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.instructions.appended``. Required. + SESSION_INSTRUCTIONS_APPENDED.""" + + @overload + def __init__( + self, + *, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED # type: ignore + + +class LiveServerEventLiveOutputTranscriptDelta( + LiveServerEvent, discriminator="session.output_transcript.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcript fragment for assistant output audio in the Live session. Accumulate fragments in + delivery order; these events do not define complete turns or include a transcript-done event. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in + delivery order to build the transcript. Required. + :vartype delta: str + :ivar type: The event type, always ``session.output_transcript.delta``. Required. + SESSION_OUTPUT_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_TRANSCRIPT_DELTA + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript text fragment for the audio in this time range. Append fragments in delivery + order to build the transcript. Required.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.output_transcript.delta``. Required. + SESSION_OUTPUT_TRANSCRIPT_DELTA.""" + + @overload + def __init__( + self, + *, + event_id: str, + start_ms: int, + end_ms: int, + delta: str, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA # type: ignore + + +class LiveServerEventLiveResponseEvent( + LiveServerEvent, discriminator="response.event" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A streaming Responses API event from a backend delegated to by the Live session. Use the outer + delegation_id to associate the nested stream with its Live delegation. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``response.event``. Required. RESPONSE_EVENT. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_EVENT + :ivar delegation_id: + :vartype delegation_id: str + :ivar event: The nested Responses streaming event. Dispatch on its type field. Response + lifecycle snapshots omit input and clear instructions, tools, and output to keep messages + small; consume granular output events for the generated content. Required. + :vartype event: dict[str, any] + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.RESPONSE_EVENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``response.event``. Required. RESPONSE_EVENT.""" + delegation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The nested Responses streaming event. Dispatch on its type field. Response lifecycle snapshots + omit input and clear instructions, tools, and output to keep messages small; consume granular + output events for the generated content. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + event: dict[str, Any], + client_event_id: Optional[str] = None, + delegation_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.RESPONSE_EVENT # type: ignore + + +class LiveServerEventLiveSessionClosed( + LiveServerEvent, discriminator="session.closed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned after the Live session finishes finalizing, with the close reason, final session + snapshot, and cumulative audio usage. A connection closing without this event does not confirm + successful finalization. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.closed``. Required. SESSION_CLOSED. + :vartype type: str or ~azure.ai.projects.models.SESSION_CLOSED + :ivar reason: Why the Live session ended: ``close_requested`` for an application close or + hangup request, ``expired`` for the session duration limit, ``content`` for a safety filter, + ``remote_hangup`` for a graceful remote disconnect, or ``connection_lost`` for an unexpected + primary or upstream disconnection. Required. Is one of the following types: + Literal["close_requested"], Literal["expired"], Literal["content"], Literal["remote_hangup"], + Literal["connection_lost"] + :vartype reason: str or str or str or str or str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.LiveSessionResourceParam + :ivar usage: The final cumulative Live audio usage after session finalization. Required. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_CLOSED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.closed``. Required. SESSION_CLOSED.""" + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Why the Live session ended: ``close_requested`` for an application close or hangup request, + ``expired`` for the session duration limit, ``content`` for a safety filter, ``remote_hangup`` + for a graceful remote disconnect, or ``connection_lost`` for an unexpected primary or upstream + disconnection. Required. Is one of the following types: Literal[\"close_requested\"], + Literal[\"expired\"], Literal[\"content\"], Literal[\"remote_hangup\"], + Literal[\"connection_lost\"]""" + session: "_models.LiveSessionResourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final cumulative Live audio usage after session finalization. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], + session: "_models.LiveSessionResourceParam", + usage: "_models.LiveSessionUsage", + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_CLOSED # type: ignore + + +class LiveServerEventLiveSessionStarted( + LiveServerEvent, discriminator="session.started" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Live session has started. Contains the resolved session configuration, + including server defaults. + + :ivar type: The event type, always ``session.started``. Required. SESSION_STARTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_STARTED + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.LiveSessionResourceParam + :ivar conversation_id: Stored conversation ID when effective store is true. Use + protocols/voice/live/conversations; this ID differs from session.id. + :vartype conversation_id: str + """ + + type: Literal[LiveServerEventType.SESSION_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.started``. Required. SESSION_STARTED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + session: "_models.LiveSessionResourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stored conversation ID when effective store is true. Use protocols/voice/live/conversations; + this ID differs from session.id.""" + + @overload + def __init__( + self, + *, + event_id: str, + session: "_models.LiveSessionResourceParam", + client_event_id: Optional[str] = None, + conversation_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_STARTED # type: ignore + + +class LiveServerEventLiveSessionUpdated( + LiveServerEvent, discriminator="session.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Live session update is accepted. Contains the resolved session configuration + after the update. + + :ivar type: The event type, always ``session.updated``. Required. SESSION_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.LiveSessionResourceParam + """ + + type: Literal[LiveServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.updated``. Required. SESSION_UPDATED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + session: "_models.LiveSessionResourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + session: "_models.LiveSessionResourceParam", + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_UPDATED # type: ignore + + +class LiveServerEventLiveSessionUsageUpdated( + LiveServerEvent, discriminator="session.usage.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reports cumulative Live audio usage and, when available, the most recent context-window usage. + Delegated Responses token usage is reported separately in response.event events. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_USAGE_UPDATED + :ivar usage: The cumulative Live audio usage so far. Required. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage + :ivar context_window: The latest measured Live context-window usage. Omitted when the context + limit is unknown. + :vartype context_window: ~azure.ai.projects.models.LiveContextWindowUsage + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_USAGE_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED.""" + usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cumulative Live audio usage so far. Required.""" + context_window: Optional["_models.LiveContextWindowUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The latest measured Live context-window usage. Omitted when the context limit is unknown.""" + + @overload + def __init__( + self, + *, + event_id: str, + usage: "_models.LiveSessionUsage", + client_event_id: Optional[str] = None, + context_window: Optional["_models.LiveContextWindowUsage"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_USAGE_UPDATED # type: ignore + + +class LiveServerEventLiveThinkingAppended( + LiveServerEvent, discriminator="session.thinking.appended" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.thinking.append command is accepted into the Live session timeline. + Acknowledges the added reasoning context without guaranteeing any spoken output. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.thinking.appended``. Required. + SESSION_THINKING_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_THINKING_APPENDED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_THINKING_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.thinking.appended``. Required. SESSION_THINKING_APPENDED.""" + + @overload + def __init__( + self, + *, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_THINKING_APPENDED # type: ignore + + +class LiveSessionAudioFormatPCMAParam( + LiveAudioFormat, discriminator="audio/pcma" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono G.711 A-law audio for a Live WebSocket connection. + + :ivar type: The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. + :vartype rate: int + """ + + type: Literal[LiveAudioFormatType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA.""" + rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" + + @overload + def __init__( + self, + *, + rate: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveAudioFormatType.AUDIO_PCMA # type: ignore + + +class LiveSessionAudioFormatPCMParam( + LiveAudioFormat, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono 16-bit little-endian PCM audio for a Live WebSocket connection. + + :ivar type: The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. + Required. Is either a Literal[16000] type or a Literal[24000] type. + :vartype rate: int or int + """ + + type: Literal[LiveAudioFormatType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM.""" + rate: Literal[16000, 24000] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. Required. Is + either a Literal[16000] type or a Literal[24000] type.""" + + @overload + def __init__( + self, + *, + rate: Literal[16000, 24000], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveAudioFormatType.AUDIO_PCM # type: ignore + + +class LiveSessionAudioFormatPCMUParam( + LiveAudioFormat, discriminator="audio/pcmu" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono G.711 μ-law audio for a Live WebSocket connection. + + :ivar type: The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. + :vartype rate: int + """ + + type: Literal[LiveAudioFormatType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU.""" + rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" + + @overload + def __init__( + self, + *, + rate: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveAudioFormatType.AUDIO_PCMU # type: ignore + + +class LiveSessionCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Initial configuration for a Live session, including its model, conversation instructions, + audio, and delegated task handling. + + :ivar model: Required. "gpt-live-1" + :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar instructions: + :vartype instructions: str + :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and + assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in + total. + :vartype input: list[~azure.ai.projects.models.LiveInitialItem] + :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC + and SIP negotiate their media format. Voice and format are immutable after startup. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar delegation: Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam + type. + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam + :ivar store: Whether to store the session for later forking and recording download. Defaults to + false for new sessions. + :vartype store: bool + :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC + session. Trusted sideband connections are unaffected. + :vartype client: ~azure.ai.projects.models.LiveClientConfigParam + """ + + model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. \"gpt-live-1\"""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.LiveInitialItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ordered text-only history supplied before startup. Supports developer, user, and assistant + messages with one text part each; at most 128 messages and 8,192 rendered tokens in total.""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup.""" + delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam type.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to store the session for later forking and recording download. Defaults to false for + new sessions.""" + client: Optional["_models.LiveClientConfigParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected.""" + + @overload + def __init__( + self, + *, + model: Union[str, "_models.ModelIdsLive"], + instructions: Optional[str] = None, + input: Optional[list["_models.LiveInitialItem"]] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = None, + store: Optional[bool] = None, + client: Optional["_models.LiveClientConfigParam"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveSessionResourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The resolved Live session configuration and server-assigned session metadata. + + :ivar model: Required. "gpt-live-1" + :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar instructions: + :vartype instructions: str + :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and + assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in + total. + :vartype input: list[~azure.ai.projects.models.LiveInitialItem] + :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC + and SIP negotiate their media format. Voice and format are immutable after startup. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar delegation: Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam + type. + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam + :ivar store: Whether to store the session for later forking and recording download. Defaults to + false for new sessions. + :vartype store: bool + :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC + session. Trusted sideband connections are unaffected. + :vartype client: ~azure.ai.projects.models.LiveClientConfigParam + :ivar id: The unique ID of the Live session. Use this ID for sideband connections, forking, and + recording download. Required. + :vartype id: str + :ivar expires_at: The Unix timestamp, in seconds, at which the Live session expires. Required. + :vartype expires_at: int + :ivar status: The status of the session snapshot. Always ``active``, including the final + snapshot in session.closed; use the event type to determine that the session has closed. + Required. Default value is "active". + :vartype status: str + """ + + model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. \"gpt-live-1\"""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.LiveInitialItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ordered text-only history supplied before startup. Supports developer, user, and assistant + messages with one text part each; at most 128 messages and 8,192 rendered tokens in total.""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup.""" + delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam type.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to store the session for later forking and recording download. Defaults to false for + new sessions.""" + client: Optional["_models.LiveClientConfigParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live session. Use this ID for sideband connections, forking, and recording + download. Required.""" + expires_at: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Unix timestamp, in seconds, at which the Live session expires. Required.""" + status: Literal["active"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status of the session snapshot. Always ``active``, including the final snapshot in + session.closed; use the event type to determine that the session has closed. Required. Default + value is \"active\".""" + + @overload + def __init__( + self, + *, + model: Union[str, "_models.ModelIdsLive"], + id: str, # pylint: disable=redefined-builtin + expires_at: int, + instructions: Optional[str] = None, + input: Optional[list["_models.LiveInitialItem"]] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = None, + store: Optional[bool] = None, + client: Optional["_models.LiveClientConfigParam"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.status: Literal["active"] = "active" + + +class LiveSessionStartEvent( + LiveClientEvent, discriminator="session.start" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Start a Live session on a primary WebSocket. Send this event before other commands and wait for + ``session.started``. + + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.start``. Required. SESSION_START. + :vartype type: str or ~azure.ai.projects.models.SESSION_START + :ivar session: Initial configuration for a primary WebSocket. Send session.start first and wait + for session.started before application commands. WebRTC creation already starts the session; do + not send this event again on its data channel. Required. + :vartype session: ~azure.ai.projects.models.LiveSessionCreateParams + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_START] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.start``. Required. SESSION_START.""" + session: "_models.LiveSessionCreateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Initial configuration for a primary WebSocket. Send session.start first and wait for + session.started before application commands. WebRTC creation already starts the session; do not + send this event again on its data channel. Required.""" + + @overload + def __init__( + self, + *, + session: "_models.LiveSessionCreateParams", + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_START # type: ignore + + +class LiveSessionUpdateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Changes to an active Live session. Only delegation backend settings can be updated after + startup. + + :ivar delegation: Is either a LiveClientDelegationParam type or a + LiveResponsesDelegationUpdateParam type. + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationUpdateParam + """ + + delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationUpdateParam"]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is either a LiveClientDelegationParam type or a LiveResponsesDelegationUpdateParam type.""" + + @overload + def __init__( + self, + *, + delegation: Optional[ + Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationUpdateParam"] + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveSessionUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cumulative audio duration for a Live session. Values are totals for the session, not increments + to sum across usage events. + + :ivar seconds: The cumulative Live audio duration in seconds. Do not sum this value across + usage events. Required. + :vartype seconds: float + """ + + seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cumulative Live audio duration in seconds. Do not sum this value across usage events. + Required.""" + + @overload + def __init__( + self, + *, + seconds: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LiveTransportAnswered( + LiveServerEvent, discriminator="transport.answered" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The outbound SIP provider leg answered and media is established. Delivered only to sideband + observers. + + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_ANSWERED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_ANSWERED + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_ANSWERED.""" + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_ANSWERED # type: ignore + + +class LiveTransportCallError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveTransportCallError. + + :ivar type: Required. Default value is "call_error". + :vartype type: str + :ivar code: The call setup failure code. Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: The parameter related to the error, if any. Empty when no parameter applies. + :vartype param: str + """ + + type: Literal["call_error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"call_error\".""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The call setup failure code. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameter related to the error, if any. Empty when no parameter applies.""" + + @overload + def __init__( + self, + *, + code: str, + message: str, + param: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["call_error"] = "call_error" + + +class LiveTransportDTMFReceived( + LiveServerEvent, discriminator="transport.dtmf.received" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A SIP DTMF keypress received from the caller. Delivered only to sideband observers. + + :ivar type: Required. TRANSPORT_DTMF_RECEIVED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_RECEIVED + :ivar event_id: Required. + :vartype event_id: str + :ivar event: Required. + :vartype event: str + """ + + type: Literal[LiveServerEventType.TRANSPORT_DTMF_RECEIVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_DTMF_RECEIVED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + event: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_DTMF_RECEIVED # type: ignore + + +class LiveTransportDTMFSend( + LiveServerEvent, discriminator="transport.dtmf.send" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to sideband observers; + this is not a client command. + + :ivar type: Required. TRANSPORT_DTMF_SEND. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_SEND + :ivar event_id: Required. + :vartype event_id: str + :ivar event: Required. + :vartype event: str + """ + + type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_DTMF_SEND.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + event: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_DTMF_SEND # type: ignore + + +class LiveTransportFailed( + LiveServerEvent, discriminator="transport.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An asynchronous outbound SIP setup failure. Delivered only to sideband observers. + + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_FAILED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_FAILED + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.LiveTransportCallError + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_FAILED.""" + error: "_models.LiveTransportCallError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str, + error: "_models.LiveTransportCallError", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_FAILED # type: ignore + + +class LiveTransportRinging( + LiveServerEvent, discriminator="transport.ringing" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband + observers. + + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_RINGING. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_RINGING + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_RINGING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_RINGING.""" + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_RINGING # type: ignore + + +class LiveWebSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """A web search tool available to the Live session’s Responses backend. + + :ivar type: The tool type. Always ``web_search``. Required. Default value is "web_search". + :vartype type: str + """ + + type: Literal["web_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool type. Always ``web_search``. Required. Default value is \"web_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["web_search"] = "web_search" + + +class LocalShellToolParam( + Tool, discriminator="local_shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Local shell tool. + + :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. + :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + """ + + type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.LOCAL_SHELL # type: ignore + + +class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LocalSkillParam. + + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar path: The path to the directory containing the skill. Required. + :vartype path: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the directory containing the skill. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + path: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A log probability object. + + :ivar token: The token that was used to generate the log probability. Required. + :vartype token: str + :ivar logprob: The log probability of the token. Required. + :vartype logprob: float + :ivar bytes: The bytes that were used to generate the log probability. Required. + :vartype bytes: list[int] + """ + + token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The token that was used to generate the log probability. Required.""" + logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probability of the token. Required.""" + bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The bytes that were used to generate the log probability. Required.""" + + @overload + def __init__( + self, + *, + token: str, + logprob: float, + bytes: list[int], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment + time. + + :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + :vartype rank: int + :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. + :vartype alpha: int + :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). + Auto-detected from adapter_config.json if omitted. + :vartype target_modules: list[str] + :ivar dropout: Dropout rate used during training. Informational — not used at serving time. + :vartype dropout: float + """ + + rank: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" + alpha: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" + target_modules: Optional[list[str]] = rest_field( + name="targetModules", visibility=["read", "create", "update", "delete", "query"] + ) + """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + adapter_config.json if omitted.""" + dropout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dropout rate used during training. Informational — not used at serving time.""" + + @overload + def __init__( + self, + *, + rank: Optional[int] = None, + alpha: Optional[int] = None, + target_modules: Optional[list[str]] = None, + dropout: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedAgentIdentityBlueprintReference( + AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """ManagedAgentIdentityBlueprintReference. + + :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. + :vartype type: str or ~azure.ai.projects.models.MANAGED_AGENT_IDENTITY_BLUEPRINT + :ivar blueprint_id: The ID of the managed blueprint. Required. + :vartype blueprint_id: str + """ + + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + blueprint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the managed blueprint. Required.""" + + @overload + def __init__( + self, + *, + blueprint_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore + + +class ManagedAzureAISearchIndex( + Index, discriminator="ManagedAzureSearch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed Azure AI Search Index Definition. + + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Managed Azure Search. + :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH + :ivar vector_store_id: Vector store id of managed index. Required. + :vartype vector_store_id: str + """ + + type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Managed Azure Search.""" + vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) + """Vector store id of managed index. Required.""" + + @overload + def __init__( + self, + *, + vector_store_id: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore + + +class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP list tools tool. + + :ivar name: The name of the tool. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar input_schema: The JSON schema describing the tool's input. Required. + :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema + :ivar annotations: + :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + name: str, + input_schema: "_models.MCPListToolsToolInputSchema", + description: Optional[str] = None, + annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MCPListToolsToolAnnotations(_Model): + """MCPListToolsToolAnnotations.""" + + +class MCPListToolsToolInputSchema(_Model): + """MCPListToolsToolInputSchema.""" + + +class McpProtocolConfiguration(_Model): + """Configuration specific to the MCP protocol.""" + + +class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -13784,7 +17213,10 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -13891,7 +17323,10 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here `_. Currently supported + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -13955,7 +17390,10 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -17287,8 +20725,9 @@ class RealtimeClientEventConversationItemCreate( """Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a "history" of the conversation and to add new items mid-stream, but has the current limitation that it cannot populate assistant - audio messages. If successful, the server will respond with a ``conversation.item.created`` - event, otherwise an ``error`` event will be sent. + audio messages. If successful, the server will emit a ``conversation.item.added`` event and, + when the item is finalized, a ``conversation.item.done`` event. Otherwise, an ``error`` event + will be sent. :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str @@ -17626,7 +21065,7 @@ class RealtimeClientEventOutputAudioBufferClear( to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be preceded by a ``response.cancel`` client event to stop the generation of the current response. `Learn more - `_. + `_. :ivar event_id: The unique ID of the client event used for error handling. :vartype event_id: str @@ -20273,7 +23712,7 @@ class RealtimeServerEventOutputAudioBufferCleared( VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current audio response. `Learn more - `_. + `_. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -25383,11 +28822,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An object specifying the format that the model must output. Configuring ``{ "type": "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied - JSON schema. Learn more in the `Structured Outputs guide `_. - The default format is ``{ "type": "text" }`` with no additional options. *Not recommended for - gpt-4o and newer models:** Setting to ``{ "type": "json_object" }`` enables the older JSON - mode, which ensures the message the model generates is valid JSON. Using ``json_schema`` is - preferred for models that support it. + JSON schema. Learn more in the `Structured Outputs guide + `_. The default format is ``{ + "type": "text" }`` with no additional options. *Not recommended for gpt-4o and newer models:** + Setting to ``{ "type": "json_object" }`` enables the older JSON mode, which ensures the message + the model generates is valid JSON. Using ``json_schema`` is preferred for models that support + it. You probably want to use the sub-classes and not this class directly. Known sub-classes are: TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText @@ -26392,8 +29832,255 @@ class ToolChoiceMCP( def __init__( self, *, - server_label: str, - name: Optional[str] = None, + server_label: str, + name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.MCP # type: ignore + + +class ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator="web_search_preview"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + """ + + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW # type: ignore + + +class ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator="web_search_preview_2025_03_11"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 + """ + + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore + + +class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-tool configuration that controls tool visibility and search behavior. + + :ivar pin: When true, the tool is always included in agent context and visible in + ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only + discoverable via ``tool_search``. + :vartype pin: bool + :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native + tool description to improve discoverability. Does not alter ``tools/list`` output. + :vartype additional_search_text: str + """ + + pin: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """When true, the tool is always included in agent context and visible in ``tools/list``. When + false (default), the tool is hidden from ``tools/list`` and only discoverable via + ``tool_search``.""" + additional_search_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional text indexed for tool_search. Supplements the native tool description to improve + discoverability. Does not alter ``tools/list`` output.""" + + @overload + def __init__( + self, + *, + pin: Optional[bool] = None, + additional_search_text: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Description of a tool that can be used by an agent. + + :ivar name: The name of the tool. + :vartype name: str + :ivar description: A brief description of the tool's purpose. + :vartype description: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A brief description of the tool's purpose.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A project connection resource. + + :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to + this tool. Required. + :vartype project_connection_id: str + """ + + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + + @overload + def __init__( + self, + *, + project_connection_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolSearchToolboxTool( + ToolboxTool, discriminator="toolbox_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox search tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH. + :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH + """ + + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolboxToolType.TOOLBOX_SEARCH # type: ignore + + +class ToolSearchToolParam( + Tool, discriminator="tool_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tool search tool. + + :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. + :vartype type: str or ~azure.ai.projects.models.TOOL_SEARCH + :ivar execution: Whether tool search is executed by the server or by the client. Known values + are: "server" and "client". + :vartype execution: str or ~azure.ai.projects.models.ToolSearchExecutionType + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + """ + + type: Literal[ToolType.TOOL_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether tool search is executed by the server or by the client. Known values are: \"server\" + and \"client\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, ) -> None: ... @overload @@ -26405,23 +30092,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.MCP # type: ignore + self.type = ToolType.TOOL_SEARCH # type: ignore -class ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator="web_search_preview"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolUseFineTuningDataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="tool_use" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The configuration for a data generation job with ToolUse type. This is a preview feature used + only for fine-tuning scenarios. - :ivar type: Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool + calling conversation between user and agent. + :vartype type: str or ~azure.ai.projects.models.TOOL_USE + :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. + Required. + :vartype max_samples: int """ - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW.""" + type: Literal[DataGenerationJobType.TOOL_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is ToolUse for this model. Required. Tool calling + conversation between user and agent.""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate, up to service-defined limits. Required.""" @overload def __init__( self, + *, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, ) -> None: ... @overload @@ -26433,23 +30138,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW # type: ignore + self.type = DataGenerationJobType.TOOL_USE # type: ignore -class ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator="web_search_preview_2025_03_11"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class TracesDataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The configuration for a data generation job with Traces type. - :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is Traces for this model. Required. Single turn + query and response from agent traces. + :vartype type: str or ~azure.ai.projects.models.TRACES + :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. If + omitted, sampling is turned off. + :vartype max_samples: int + :ivar redact_private_content: Whether to redact private content from traces. When omitted or + set to true, private content is redacted. Set to false to opt out of redaction. + :vartype redact_private_content: bool """ - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" + type: Literal[DataGenerationJobType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is Traces for this model. Required. Single turn query and + response from agent traces.""" + max_samples: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate, up to service-defined limits. If omitted, sampling is + turned off.""" + redact_private_content: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to redact private content from traces. When omitted or set to true, private content is + redacted. Set to false to opt out of redaction.""" @overload def __init__( self, + *, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + max_samples: Optional[int] = None, + redact_private_content: Optional[bool] = None, ) -> None: ... @overload @@ -26461,35 +30191,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore + self.type = DataGenerationJobType.TRACES # type: ignore -class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-tool configuration that controls tool visibility and search behavior. +class TracesDataGenerationJobSource( + DataGenerationJobSource, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Traces source for data generation jobs — conversation traces from Application Insights. - :ivar pin: When true, the tool is always included in agent context and visible in - ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only - discoverable via ``tool_search``. - :vartype pin: bool - :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native - tool description to improve discoverability. Does not alter ``tools/list`` output. - :vartype additional_search_text: str + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Traces. Required. Traces source — + conversation traces from Application Insights. + :vartype type: str or ~azure.ai.projects.models.TRACES + :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_id: str + :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent + are included within the time window. + :vartype agent_version: str + :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. + Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: ~datetime.datetime + :ivar trace_ids: Optional explicit list of trace IDs to include. + :vartype trace_ids: list[str] """ - pin: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When true, the tool is always included in agent context and visible in ``tools/list``. When - false (default), the tool is hidden from ``tools/list`` and only discoverable via - ``tool_search``.""" - additional_search_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional text indexed for tool_search. Supplements the native tool description to improve - discoverability. Does not alter ``tools/list`` output.""" + type: Literal[DataGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + trace_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional explicit list of trace IDs to include.""" @overload def __init__( self, *, - pin: Optional[bool] = None, - additional_search_text: Optional[str] = None, + start_time: datetime.datetime, + description: Optional[str] = None, + agent_id: Optional[str] = None, + agent_name: Optional[str] = None, + agent_version: Optional[str] = None, + end_time: Optional[datetime.datetime] = None, + trace_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -26501,28 +30269,71 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DataGenerationJobSourceType.TRACES # type: ignore -class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Description of a tool that can be used by an agent. +class TracesEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="traces" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Traces source for evaluator generation jobs — conversation traces from Application Insights. - :ivar name: The name of the tool. - :vartype name: str - :ivar description: A brief description of the tool's purpose. + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). :vartype description: str + :ivar type: The source type for this source, which is Traces. Required. Traces source — + conversation traces from Application Insights. + :vartype type: str or ~azure.ai.projects.models.TRACES + :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_id: str + :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent + are included within the time window. + :vartype agent_version: str + :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. + Required. + :vartype start_time: ~datetime.datetime + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: ~datetime.datetime """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A brief description of the tool's purpose.""" + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Literal[EvaluatorGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" @overload def __init__( self, *, - name: Optional[str] = None, + start_time: datetime.datetime, description: Optional[str] = None, + agent_id: Optional[str] = None, + agent_name: Optional[str] = None, + agent_version: Optional[str] = None, + end_time: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -26534,24 +30345,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluatorGenerationJobSourceType.TRACES # type: ignore -class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A project connection resource. +class TranscriptionLanguage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A language detected in transcribed audio. - :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to - this tool. Required. - :vartype project_connection_id: str + :ivar code: The code of a language detected in the audio. Required. + :vartype code: str """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The code of a language detected in the audio. Required.""" @overload def __init__( self, *, - project_connection_id: str, + code: str, ) -> None: ... @overload @@ -26565,33 +30376,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolSearchToolboxTool( - ToolboxTool, discriminator="toolbox_search" +class TranscriptTextUsageDuration( + CreateTranscriptionResponseJsonUsage, discriminator="duration" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. - - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH. - :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH + """Duration Usage. + + :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. + DURATION. + :vartype type: str or ~azure.ai.projects.models.DURATION + :ivar seconds: Duration of the input audio in seconds. Required. + :vartype seconds: ~datetime.timedelta """ - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``toolbox_search``. Required. TOOLBOX_SEARCH.""" + type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" + seconds: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """Duration of the input audio in seconds. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + seconds: datetime.timedelta, ) -> None: ... @overload @@ -26603,44 +30411,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.TOOLBOX_SEARCH # type: ignore + self.type = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore -class ToolSearchToolParam( - Tool, discriminator="tool_search" +class TranscriptTextUsageTokens( + CreateTranscriptionResponseJsonUsage, discriminator="tokens" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Tool search tool. + """Token Usage. - :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. - :vartype type: str or ~azure.ai.projects.models.TOOL_SEARCH - :ivar execution: Whether tool search is executed by the server or by the client. Known values - are: "server" and "client". - :vartype execution: str or ~azure.ai.projects.models.ToolSearchExecutionType - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. + :vartype type: str or ~azure.ai.projects.models.TOKENS + :ivar input_tokens: Number of input tokens billed for this request. Required. + :vartype input_tokens: int + :ivar input_token_details: Details about the input tokens billed for this request. + :vartype input_token_details: + ~azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails + :ivar output_tokens: Number of output tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total number of tokens used (input + output). Required. + :vartype total_tokens: int """ - type: Literal[ToolType.TOOL_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether tool search is executed by the server or by the client. Known values are: \"server\" - and \"client\".""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional["_models.EmptyModelParam"] = rest_field( + type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of input tokens billed for this request. Required.""" + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """Details about the input tokens billed for this request.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of output tokens generated. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Total number of tokens used (input + output). Required.""" @overload def __init__( self, *, - execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, - description: Optional[str] = None, - parameters: Optional["_models.EmptyModelParam"] = None, + input_tokens: int, + output_tokens: int, + total_tokens: int, + input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, ) -> None: ... @overload @@ -26652,41 +30464,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.TOOL_SEARCH # type: ignore + self.type = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore -class ToolUseFineTuningDataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="tool_use" +class TranscriptTextUsageTokensInputTokenDetails( + _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The configuration for a data generation job with ToolUse type. This is a preview feature used - only for fine-tuning scenarios. + """TranscriptTextUsageTokensInputTokenDetails. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool - calling conversation between user and agent. - :vartype type: str or ~azure.ai.projects.models.TOOL_USE - :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. - Required. - :vartype max_samples: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - type: Literal[DataGenerationJobType.TOOL_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is ToolUse for this model. Required. Tool calling - conversation between user and agent.""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate, up to service-defined limits. Required.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -26698,48 +30498,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.TOOL_USE # type: ignore -class TracesDataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="traces" +class TwilioTelephonyBinding( + TelephonyBinding, discriminator="twilio" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The configuration for a data generation job with Traces type. + """A Twilio binding owned by a voice agent. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is Traces for this model. Required. Single turn - query and response from agent traces. - :vartype type: str or ~azure.ai.projects.models.TRACES - :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. If - omitted, sampling is turned off. - :vartype max_samples: int - :ivar redact_private_content: Whether to redact private content from traces. When omitted or - set to true, private content is redacted. Set to false to opt out of redaction. - :vartype redact_private_content: bool + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. + :vartype provider: str or ~azure.ai.projects.models.TWILIO + :ivar phone_number: The Twilio E.164 phone number. Required. + :vartype phone_number: str """ - type: Literal[DataGenerationJobType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is Traces for this model. Required. Single turn query and - response from agent traces.""" - max_samples: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate, up to service-defined limits. If omitted, sampling is - turned off.""" - redact_private_content: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to redact private content from traces. When omitted or set to true, private content is - redacted. Set to false to opt out of redaction.""" + provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Twilio provider. Required. Twilio Programmable Voice.""" + phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Twilio E.164 phone number. Required.""" @overload def __init__( self, *, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, - max_samples: Optional[int] = None, - redact_private_content: Optional[bool] = None, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + phone_number: str, + label: Optional[str] = None, ) -> None: ... @overload @@ -26751,73 +30548,83 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.TRACES # type: ignore + self.provider = TelephonyProvider.TWILIO # type: ignore -class TracesDataGenerationJobSource( - DataGenerationJobSource, discriminator="traces" +class TwilioTelephonyBindingListItem( + TelephonyBindingListItem, discriminator="twilio" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Traces source for data generation jobs — conversation traces from Application Insights. + """A Twilio binding returned in a list, including its entity tag. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Traces. Required. Traces source — - conversation traces from Application Insights. - :vartype type: str or ~azure.ai.projects.models.TRACES - :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_id: str - :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_name: str - :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent - are included within the time window. - :vartype agent_version: str - :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. - Required. - :vartype start_time: ~datetime.datetime - :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. - :vartype end_time: ~datetime.datetime - :ivar trace_ids: Optional explicit list of trace IDs to include. - :vartype trace_ids: list[str] + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this + binding. Required. + :vartype etag: str + :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. + :vartype provider: str or ~azure.ai.projects.models.TWILIO + :ivar phone_number: The Twilio E.164 phone number. Required. + :vartype phone_number: str """ - type: Literal[DataGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Traces. Required. Traces source — conversation traces - from Application Insights.""" - agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at - least one is required.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least - one is required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version. If not specified, traces for ALL versions of the agent are included within - the time window.""" - start_time: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" - end_time: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" - trace_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional explicit list of trace IDs to include.""" + provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Twilio provider. Required. Twilio Programmable Voice.""" + phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Twilio E.164 phone number. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + phone_number: str, + label: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.provider = TelephonyProvider.TWILIO # type: ignore + + +class UpdateModelVersionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for updating a model version. Only description and tags can be modified. + + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - start_time: datetime.datetime, description: Optional[str] = None, - agent_id: Optional[str] = None, - agent_name: Optional[str] = None, - agent_version: Optional[str] = None, - end_time: Optional[datetime.datetime] = None, - trace_ids: Optional[list[str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -26829,71 +30636,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.TRACES # type: ignore -class TracesEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="traces" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Traces source for evaluator generation jobs — conversation traces from Application Insights. +class UpdateTelephonyBindingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request to update an existing telephony binding. Every property is optional and the + binding's provider is immutable. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Traces. Required. Traces source — - conversation traces from Application Insights. - :vartype type: str or ~azure.ai.projects.models.TRACES - :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_id: str - :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or - ``agent_name`` — at least one is required. - :vartype agent_name: str - :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent - are included within the time window. - :vartype agent_version: str - :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. - Required. - :vartype start_time: ~datetime.datetime - :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. - :vartype end_time: ~datetime.datetime + :ivar status: The new lifecycle status. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar label: The replacement display label. Omit it to preserve the current value; use null to + clear it. + :vartype label: str + :ivar connection_name: The replacement Foundry connection name. This property is valid only for + a Teams Phone extensibility binding; a Twilio binding's connection is immutable. + :vartype connection_name: str + :ivar phone_number: The replacement Teams Phone extensibility display phone number. Omit it to + preserve the current value; use null to clear it. This property is valid only for a Teams Phone + extensibility binding. + :vartype phone_number: str """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of what this source represents — helps the pipeline interpret its content - (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" - type: Literal[EvaluatorGenerationJobSourceType.TRACES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Traces. Required. Traces source — conversation traces - from Application Insights.""" - agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at - least one is required.""" - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least - one is required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version. If not specified, traces for ALL versions of the agent are included within - the time window.""" - start_time: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" - end_time: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + """The new lifecycle status. Known values are: \"active\" and \"suspended\".""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement display label. Omit it to preserve the current value; use null to clear it.""" + connection_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement Foundry connection name. This property is valid only for a Teams Phone + extensibility binding; a Twilio binding's connection is immutable.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The replacement Teams Phone extensibility display phone number. Omit it to preserve the current + value; use null to clear it. This property is valid only for a Teams Phone extensibility + binding.""" @overload def __init__( self, *, - start_time: datetime.datetime, - description: Optional[str] = None, - agent_id: Optional[str] = None, - agent_name: Optional[str] = None, - agent_version: Optional[str] = None, - end_time: Optional[datetime.datetime] = None, + status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = None, + label: Optional[str] = None, + connection_name: Optional[str] = None, + phone_number: Optional[str] = None, ) -> None: ... @overload @@ -26905,24 +30689,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.TRACES # type: ignore -class TranscriptionLanguage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A language detected in transcribed audio. +class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """UpdateToolboxRequest. - :ivar code: The code of a language detected in the audio. Required. - :vartype code: str + :ivar default_version: The version identifier that the toolbox should point to. When set, the + toolbox's default version will resolve to this version instead of the latest. Required. + :vartype default_version: str """ - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The code of a language detected in the audio. Required.""" + default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier that the toolbox should point to. When set, the toolbox's default + version will resolve to this version instead of the latest. Required.""" @overload def __init__( self, *, - code: str, + default_version: str, ) -> None: ... @overload @@ -26936,30 +30721,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TranscriptTextUsageDuration( - CreateTranscriptionResponseJsonUsage, discriminator="duration" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Duration Usage. +class UserConversationSimulationAudioEffectsConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Configures effects applied to simulated conversation audio. - :ivar type: The type of the usage object. Always ``duration`` for this variant. Required. - DURATION. - :vartype type: str or ~azure.ai.projects.models.DURATION - :ivar seconds: Duration of the input audio in seconds. Required. - :vartype seconds: ~datetime.timedelta + :ivar effects: Effects to apply to simulated audio. + :vartype effects: list[str or ~azure.ai.projects.models.UserConversationSimulationAudioEffect] + :ivar volume_percentage: Volume of the configured audio effects, as a percentage from 1 through + 100. When omitted, the service defaults to 15. + :vartype volume_percentage: int """ - type: Literal[CreateTranscriptionResponseJsonUsageType.DURATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the usage object. Always ``duration`` for this variant. Required. DURATION.""" - seconds: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Duration of the input audio in seconds. Required.""" + """Effects to apply to simulated audio.""" + volume_percentage: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Volume of the configured audio effects, as a percentage from 1 through 100. When omitted, the + service defaults to 15.""" @overload def __init__( self, *, - seconds: datetime.timedelta, + effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = None, + volume_percentage: Optional[int] = None, ) -> None: ... @overload @@ -26971,48 +30758,92 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CreateTranscriptionResponseJsonUsageType.DURATION # type: ignore -class TranscriptTextUsageTokens( - CreateTranscriptionResponseJsonUsage, discriminator="tokens" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Token Usage. +class UserConversationSimulationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configures the number, length, audio effects, and simulated user behavior of conversations. - :ivar type: The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS. - :vartype type: str or ~azure.ai.projects.models.TOKENS - :ivar input_tokens: Number of input tokens billed for this request. Required. - :vartype input_tokens: int - :ivar input_token_details: Details about the input tokens billed for this request. - :vartype input_token_details: - ~azure.ai.projects.models.TranscriptTextUsageTokensInputTokenDetails - :ivar output_tokens: Number of output tokens generated. Required. - :vartype output_tokens: int - :ivar total_tokens: Total number of tokens used (input + output). Required. - :vartype total_tokens: int + :ivar max_num_turns: Hard limit on turns in each conversation. When omitted, the service + defaults to 20. + :vartype max_num_turns: int + :ivar conversation_repetitions: Number of independent conversation repetitions for each test + case. Defaults to 1 when not specified at either the data-source or test-case level. + :vartype conversation_repetitions: int + :ivar desired_num_turns: Target number of turns in each conversation. The effective value + cannot exceed the effective ``max_num_turns``. When omitted, no target is set and the + simulation model determines the conversation length dynamically from the scenario. + :vartype desired_num_turns: int + :ivar audio_effects: Audio effects applied to voice conversation simulations. This property is + ignored for text-only simulations. + :vartype audio_effects: + ~azure.ai.projects.models.UserConversationSimulationAudioEffectsConfiguration + :ivar user_behavior: Conversation behavior of the simulated user. + :vartype user_behavior: + ~azure.ai.projects.models.UserConversationSimulationUserBehaviorConfiguration """ - type: Literal[CreateTranscriptionResponseJsonUsageType.TOKENS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the usage object. Always ``tokens`` for this variant. Required. TOKENS.""" - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of input tokens billed for this request. Required.""" - input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = rest_field( + max_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Hard limit on turns in each conversation. When omitted, the service defaults to 20.""" + conversation_repetitions: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of independent conversation repetitions for each test case. Defaults to 1 when not + specified at either the data-source or test-case level.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target number of turns in each conversation. The effective value cannot exceed the effective + ``max_num_turns``. When omitted, no target is set and the simulation model determines the + conversation length dynamically from the scenario.""" + audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Details about the input tokens billed for this request.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of output tokens generated. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total number of tokens used (input + output). Required.""" + """Audio effects applied to voice conversation simulations. This property is ignored for text-only + simulations.""" + user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Conversation behavior of the simulated user.""" + + @overload + def __init__( + self, + *, + max_num_turns: Optional[int] = None, + conversation_repetitions: Optional[int] = None, + desired_num_turns: Optional[int] = None, + audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = None, + user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserConversationSimulationInterruptionConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Configuration for simulated user interruption behavior. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + UserConversationSimulationDefaultInterruptionConfiguration + + :ivar type: The interruption type. Required. Default value is None. + :vartype type: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The interruption type. Required. Default value is None.""" @overload def __init__( self, *, - input_tokens: int, - output_tokens: int, - total_tokens: int, - input_token_details: Optional["_models.TranscriptTextUsageTokensInputTokenDetails"] = None, + type: str, ) -> None: ... @overload @@ -27024,29 +30855,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CreateTranscriptionResponseJsonUsageType.TOKENS # type: ignore -class TranscriptTextUsageTokensInputTokenDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """TranscriptTextUsageTokensInputTokenDetails. +class UserConversationSimulationDefaultInterruptionConfiguration( + UserConversationSimulationInterruptionConfiguration, discriminator="default" +): # pylint: disable=name-too-long + """Configures the default interruption behavior for the simulated user. - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :ivar type: The interruption type, always ``default``. Required. Default value is "default". + :vartype type: str """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["default"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The interruption type, always ``default``. Required. Default value is \"default\".""" @overload def __init__( self, - *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -27058,45 +30883,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "default" # type: ignore -class TwilioTelephonyBinding( - TelephonyBinding, discriminator="twilio" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Twilio binding owned by a voice agent. +class UserConversationSimulationTestCase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Defines one test scenario. Simulation configuration properties specified here override the + corresponding data-source defaults. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. - :vartype provider: str or ~azure.ai.projects.models.TWILIO - :ivar phone_number: The Twilio E.164 phone number. Required. - :vartype phone_number: str + :ivar test_case_id: Identifier for the test case. When omitted, the service generates a random + identifier. + :vartype test_case_id: str + :ivar test_case_category: Category used to group related test cases. When omitted, the service + leaves the category null. + :vartype test_case_category: str + :ivar test_case_description: Scenario, simulated user goal, and behavioral constraints that + guide the conversation. The length must be from 1 through 2,500 characters. + :vartype test_case_description: str + :ivar simulation_configuration: Configuration for conversations generated from this test case. + Each specified property overrides the corresponding property in + ``default_simulation_configuration``. + :vartype simulation_configuration: + ~azure.ai.projects.models.UserConversationSimulationConfiguration """ - provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Twilio provider. Required. Twilio Programmable Voice.""" - phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Twilio E.164 phone number. Required.""" + test_case_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the test case. When omitted, the service generates a random identifier.""" + test_case_category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Category used to group related test cases. When omitted, the service leaves the category null.""" + test_case_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Scenario, simulated user goal, and behavioral constraints that guide the conversation. The + length must be from 1 through 2,500 characters.""" + simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for conversations generated from this test case. Each specified property + overrides the corresponding property in ``default_simulation_configuration``.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - phone_number: str, - label: Optional[str] = None, + test_case_id: Optional[str] = None, + test_case_category: Optional[str] = None, + test_case_description: Optional[str] = None, + simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = None, ) -> None: ... @overload @@ -27108,49 +30938,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TWILIO # type: ignore -class TwilioTelephonyBindingListItem( - TelephonyBindingListItem, discriminator="twilio" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Twilio binding returned in a list, including its entity tag. +class UserConversationSimulationUserBehaviorConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Configures conversation behavior for the simulated user. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this - binding. Required. - :vartype etag: str - :ivar provider: The Twilio provider. Required. Twilio Programmable Voice. - :vartype provider: str or ~azure.ai.projects.models.TWILIO - :ivar phone_number: The Twilio E.164 phone number. Required. - :vartype phone_number: str + :ivar interruption: Configures how the simulated user interrupts the target while it is + speaking. Omit to disable interruption. + :vartype interruption: + ~azure.ai.projects.models.UserConversationSimulationInterruptionConfiguration """ - provider: Literal[TelephonyProvider.TWILIO] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Twilio provider. Required. Twilio Programmable Voice.""" - phone_number: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Twilio E.164 phone number. Required.""" + interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configures how the simulated user interrupts the target while it is speaking. Omit to disable + interruption.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - phone_number: str, - label: Optional[str] = None, + interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = None, ) -> None: ... @overload @@ -27162,29 +30973,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TWILIO # type: ignore -class UpdateModelVersionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request body for updating a model version. Only description and tags can be modified. +class UserProfileMemoryItem( + MemoryItem, discriminator="user_profile" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory item specifically containing user profile information extracted from conversations, + such as preferences, interests, and personal details. - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] + :ivar memory_id: The unique ID of the memory item. Required. + :vartype memory_id: str + :ivar updated_at: The last update time of the memory item. Required. + :vartype updated_at: ~datetime.datetime + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. User profile information extracted from + conversations. + :vartype kind: str or ~azure.ai.projects.models.USER_PROFILE """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + kind: Literal[MemoryItemKind.USER_PROFILE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. User profile information extracted from conversations.""" @overload def __init__( self, *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -27196,48 +31017,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = MemoryItemKind.USER_PROFILE # type: ignore -class UpdateTelephonyBindingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The request to update an existing telephony binding. Every property is optional and the - binding's provider is immutable. +class VersionIndicator(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Version indicator determining which agent version backs the session. - :ivar status: The new lifecycle status. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar label: The replacement display label. Omit it to preserve the current value; use null to - clear it. - :vartype label: str - :ivar connection_name: The replacement Foundry connection name. This property is valid only for - a Teams Phone extensibility binding; a Twilio binding's connection is immutable. - :vartype connection_name: str - :ivar phone_number: The replacement Teams Phone extensibility display phone number. Omit it to - preserve the current value; use null to clear it. This property is valid only for a Teams Phone - extensibility binding. - :vartype phone_number: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VersionRefIndicator + + :ivar type: The type of version indicator. Required. "version_ref" + :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType """ - status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The new lifecycle status. Known values are: \"active\" and \"suspended\".""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The replacement display label. Omit it to preserve the current value; use null to clear it.""" - connection_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The replacement Foundry connection name. This property is valid only for a Teams Phone - extensibility binding; a Twilio binding's connection is immutable.""" - phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The replacement Teams Phone extensibility display phone number. Omit it to preserve the current - value; use null to clear it. This property is valid only for a Teams Phone extensibility - binding.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of version indicator. Required. \"version_ref\"""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.TelephonyBindingStatus"]] = None, - label: Optional[str] = None, - connection_name: Optional[str] = None, - phone_number: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -27251,23 +31052,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateToolboxRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """UpdateToolboxRequest. +class VersionRefIndicator( + VersionIndicator, discriminator="version_ref" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Version indicator that references a specific agent version by name. - :ivar default_version: The version identifier that the toolbox should point to. When set, the - toolbox's default version will resolve to this version instead of the latest. Required. - :vartype default_version: str + :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent + version. + :vartype type: str or ~azure.ai.projects.models.VERSION_REF + :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. + :vartype agent_version: str """ - default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier that the toolbox should point to. When set, the toolbox's default - version will resolve to this version instead of the latest. Required.""" + type: Literal[VersionIndicatorType.VERSION_REF] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent version identifier returned by the agent version APIs. Required.""" @overload def __init__( self, *, - default_version: str, + agent_version: str, ) -> None: ... @overload @@ -27279,34 +31085,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VersionIndicatorType.VERSION_REF # type: ignore - -class UserConversationSimulationAudioEffectsConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Configures effects applied to simulated conversation audio. - - :ivar effects: Effects to apply to simulated audio. - :vartype effects: list[str or ~azure.ai.projects.models.UserConversationSimulationAudioEffect] - :ivar volume_percentage: Volume of the configured audio effects, as a percentage from 1 through - 100. When omitted, the service defaults to 15. - :vartype volume_percentage: int + +class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VersionSelector. + + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] """ - effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = rest_field( + version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Effects to apply to simulated audio.""" - volume_percentage: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Volume of the configured audio effects, as a percentage from 1 through 100. When omitted, the - service defaults to 15.""" + """Required.""" @overload def __init__( self, *, - effects: Optional[list[Union[str, "_models.UserConversationSimulationAudioEffect"]]] = None, - volume_percentage: Optional[int] = None, + version_selection_rules: list["_models.VersionSelectionRule"], ) -> None: ... @overload @@ -27320,56 +31118,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configures the number, length, audio effects, and simulated user behavior of conversations. +class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Animation settings for a voice-agent session. - :ivar max_num_turns: Hard limit on turns in each conversation. When omitted, the service - defaults to 20. - :vartype max_num_turns: int - :ivar conversation_repetitions: Number of independent conversation repetitions for each test - case. Defaults to 1 when not specified at either the data-source or test-case level. - :vartype conversation_repetitions: int - :ivar desired_num_turns: Target number of turns in each conversation. The effective value - cannot exceed the effective ``max_num_turns``. When omitted, no target is set and the - simulation model determines the conversation length dynamically from the scenario. - :vartype desired_num_turns: int - :ivar audio_effects: Audio effects applied to voice conversation simulations. This property is - ignored for text-only simulations. - :vartype audio_effects: - ~azure.ai.projects.models.UserConversationSimulationAudioEffectsConfiguration - :ivar user_behavior: Conversation behavior of the simulated user. - :vartype user_behavior: - ~azure.ai.projects.models.UserConversationSimulationUserBehaviorConfiguration + :ivar model_name: The animation model name. + :vartype model_name: str + :ivar outputs: The requested animation output kinds. + :vartype outputs: list[str or ~azure.ai.projects.models.VoiceAgentAnimationOutputType] """ - max_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Hard limit on turns in each conversation. When omitted, the service defaults to 20.""" - conversation_repetitions: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of independent conversation repetitions for each test case. Defaults to 1 when not - specified at either the data-source or test-case level.""" - desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target number of turns in each conversation. The effective value cannot exceed the effective - ``max_num_turns``. When omitted, no target is set and the simulation model determines the - conversation length dynamically from the scenario.""" - audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Audio effects applied to voice conversation simulations. This property is ignored for text-only - simulations.""" - user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = rest_field( + model_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The animation model name.""" + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Conversation behavior of the simulated user.""" + """The requested animation output kinds.""" @overload def __init__( self, *, - max_num_turns: Optional[int] = None, - conversation_repetitions: Optional[int] = None, - desired_num_turns: Optional[int] = None, - audio_effects: Optional["_models.UserConversationSimulationAudioEffectsConfiguration"] = None, - user_behavior: Optional["_models.UserConversationSimulationUserBehaviorConfiguration"] = None, + model_name: Optional[str] = None, + outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, ) -> None: ... @overload @@ -27383,27 +31153,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationInterruptionConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Configuration for simulated user interruption behavior. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - UserConversationSimulationDefaultInterruptionConfiguration +class VoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The audio configuration for a voice agent. These values are session defaults and may be + overridden when connecting. - :ivar type: The interruption type. Required. Default value is None. - :vartype type: str + :ivar input: Input (microphone) audio configuration. + :vartype input: ~azure.ai.projects.models.VoiceAgentAudioInputConfig + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The interruption type. Required. Default value is None.""" + input: Optional["_models.VoiceAgentAudioInputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input (microphone) audio configuration.""" + output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output (agent speech) audio configuration.""" @overload def __init__( self, *, - type: str, + input: Optional["_models.VoiceAgentAudioInputConfig"] = None, + output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, ) -> None: ... @overload @@ -27417,21 +31191,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationDefaultInterruptionConfiguration( - UserConversationSimulationInterruptionConfiguration, discriminator="default" -): # pylint: disable=name-too-long - """Configures the default interruption behavior for the simulated user. +class VoiceAgentAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Input audio configuration for a voice agent. - :ivar type: The interruption type, always ``default``. Required. Default value is "default". - :vartype type: str + :ivar format: The input audio format. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + :ivar noise_reduction: Input noise reduction. Set to null to disable. + :vartype noise_reduction: ~azure.ai.projects.models.VoiceAgentNoiseReduction + :ivar turn_detection: Turn (end-of-speech) detection. Server-side turn detection is enabled by + default; set to null to disable it, in which case the client must trigger responses manually. + :vartype turn_detection: ~azure.ai.projects.models.VoiceAgentTurnDetectionConfig + :ivar echo_cancellation: Optional server-side echo cancellation settings. + :vartype echo_cancellation: ~azure.ai.projects.models.VoiceAgentEchoCancellation + :ivar transcription: Asynchronous input-audio transcription. Set to null to disable + transcription. + :vartype transcription: ~azure.ai.projects.models.VoiceAgentInputTranscription """ - type: Literal["default"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The interruption type, always ``default``. Required. Default value is \"default\".""" + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input audio format.""" + noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input noise reduction. Set to null to disable.""" + turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Turn (end-of-speech) detection. Server-side turn detection is enabled by default; set to null + to disable it, in which case the client must trigger responses manually.""" + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional server-side echo cancellation settings.""" + transcription: Optional["_models.VoiceAgentInputTranscription"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Asynchronous input-audio transcription. Set to null to disable transcription.""" @overload def __init__( self, + *, + format: Optional["_models.RealtimeAudioFormats"] = None, + noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = None, + turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = None, + echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, + transcription: Optional["_models.VoiceAgentInputTranscription"] = None, ) -> None: ... @overload @@ -27443,50 +31250,141 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "default" # type: ignore -class UserConversationSimulationTestCase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Defines one test scenario. Simulation configuration properties specified here override the - corresponding data-source defaults. +class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Output audio configuration for a voice agent. + Provider-specific fields are selected by ``voice_type``: - :ivar test_case_id: Identifier for the test case. When omitted, the service generates a random - identifier. - :vartype test_case_id: str - :ivar test_case_category: Category used to group related test cases. When omitted, the service - leaves the category null. - :vartype test_case_category: str - :ivar test_case_description: Scenario, simulated user goal, and behavioral constraints that - guide the conversation. The length must be from 1 through 2,500 characters. - :vartype test_case_description: str - :ivar simulation_configuration: Configuration for conversations generated from this test case. - Each specified property overrides the corresponding property in - ``default_simulation_configuration``. - :vartype simulation_configuration: - ~azure.ai.projects.models.UserConversationSimulationConfiguration + * `openai`: `voice` and `speed`. + * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, + `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. + * `azure-custom`: all `azure-standard` fields except `style`, plus `custom_voice_endpoint_id`. + * `azure-personal`: all `azure-standard` fields except `style`, plus `personal_voice_model`. + * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus `personal_voice_model`; the + voice name is derived from the avatar. + * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice + type. + + :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz + PCM. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + :ivar voice: The voice name or identifier. Applies to ``openai``, ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``azure-realtime-native``. It does not apply to + ``avatar-voice-sync``, which derives the voice name from the avatar. + :vartype voice: str + :ivar voice_type: The voice implementation. Known values are: "openai", "azure-standard", + "azure-custom", "azure-personal", "avatar-voice-sync", and "azure-realtime-native". + :vartype voice_type: str or ~azure.ai.projects.models.VoiceType + :ivar voice_locale: The enforced BCP-47 output locale. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype voice_locale: str + :ivar speed: The numeric output speed multiplier. Applies to all known ``voice_type`` values + and defaults to 1. + :vartype speed: float + :ivar voice_temperature: The voice variation temperature. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype voice_temperature: float + :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. Applies to + ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: The URL of a custom text-normalization configuration. + Applies to ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred BCP-47 locales for multilingual synthesis. Applies to + ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. + :vartype prefer_locales: list[str] + :ivar style: The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``. + :vartype style: str + :ivar pitch: The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``. + :vartype pitch: str + :ivar volume: The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``. + :vartype volume: str + :ivar custom_voice_endpoint_id: The Azure custom-voice deployment endpoint identifier. Applies + only when ``voice_type`` is ``azure-custom``. + :vartype custom_voice_endpoint_id: str + :ivar personal_voice_model: The Azure personal or avatar voice model. Applies only when + ``voice_type`` is ``azure-personal`` or ``avatar-voice-sync``. + :vartype personal_voice_model: str + :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. Applies to + every ``voice_type``. + :vartype output_audio_timestamp_types: list[str or + ~azure.ai.projects.models.VoiceAgentAudioTimestampType] """ - test_case_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the test case. When omitted, the service generates a random identifier.""" - test_case_category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Category used to group related test cases. When omitted, the service leaves the category null.""" - test_case_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Scenario, simulated user goal, and behavioral constraints that guide the conversation. The - length must be from 1 through 2,500 characters.""" - simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = rest_field( + format: Optional["_models.RealtimeAudioFormats"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM.""" + voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice name or identifier. Applies to ``openai``, ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``azure-realtime-native``. It does not apply to ``avatar-voice-sync``, + which derives the voice name from the avatar.""" + voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The voice implementation. Known values are: \"openai\", \"azure-standard\", \"azure-custom\", + \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" + voice_locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The numeric output speed multiplier. Applies to all known ``voice_type`` values and defaults to + 1.""" + voice_temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice variation temperature. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL of a custom pronunciation lexicon. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_text_normalization_url: Optional[str] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for conversations generated from this test case. Each specified property - overrides the corresponding property in ``default_simulation_configuration``.""" + """The URL of a custom text-normalization configuration. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" + prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preferred BCP-47 locales for multilingual synthesis. Applies to ``azure-standard``, + ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``.""" + pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, + ``azure-personal``, and ``avatar-voice-sync``.""" + custom_voice_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure custom-voice deployment endpoint identifier. Applies only when ``voice_type`` is + ``azure-custom``.""" + personal_voice_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure personal or avatar voice model. Applies only when ``voice_type`` is + ``azure-personal`` or ``avatar-voice-sync``.""" + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" @overload def __init__( self, *, - test_case_id: Optional[str] = None, - test_case_category: Optional[str] = None, - test_case_description: Optional[str] = None, - simulation_configuration: Optional["_models.UserConversationSimulationConfiguration"] = None, + format: Optional["_models.RealtimeAudioFormats"] = None, + voice: Optional[str] = None, + voice_type: Optional[Union[str, "_models.VoiceType"]] = None, + voice_locale: Optional[str] = None, + speed: Optional[float] = None, + voice_temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + volume: Optional[str] = None, + custom_voice_endpoint_id: Optional[str] = None, + personal_voice_model: Optional[str] = None, + output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = None, ) -> None: ... @overload @@ -27500,28 +31398,72 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserConversationSimulationUserBehaviorConfiguration( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Configures conversation behavior for the simulated user. +class VoiceAgentAvatarConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar configuration for a voice agent. These values are session defaults and may be overridden + when connecting. - :ivar interruption: Configures how the simulated user interrupts the target while it is - speaking. Omit to disable interruption. - :vartype interruption: - ~azure.ai.projects.models.UserConversationSimulationInterruptionConfiguration + :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentAvatarType + :ivar character: The avatar character identifier, e.g. 'lisa'. Required. + :vartype character: str + :ivar style: The avatar style, e.g. 'casual-sitting'. + :vartype style: str + :ivar customized: Whether the avatar is a customer-customized avatar. Defaults to false. + :vartype customized: bool + :ivar output_protocol: The transport used to deliver the avatar video stream. Known values are: + "webrtc" and "websocket". + :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAgentAvatarOutputProtocol + :ivar model: The avatar model identifier. + :vartype model: str + :ivar video: Avatar video encoder and presentation settings. + :vartype video: ~azure.ai.projects.models.VoiceAgentAvatarVideoParams + :ivar scene: Avatar placement and motion settings. + :vartype scene: ~azure.ai.projects.models.VoiceAgentAvatarScene + :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. + :vartype output_audit_audio: bool """ - interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = rest_field( + type: Union[str, "_models.VoiceAgentAvatarType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Configures how the simulated user interrupts the target while it is speaking. Omit to disable - interruption.""" + """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" + character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The avatar character identifier, e.g. 'lisa'. Required.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The avatar style, e.g. 'casual-sitting'.""" + customized: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the avatar is a customer-customized avatar. Defaults to false.""" + output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and + \"websocket\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The avatar model identifier.""" + video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Avatar video encoder and presentation settings.""" + scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Avatar placement and motion settings.""" + output_audit_audio: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether audit audio is emitted with avatar output. Defaults to false.""" @overload def __init__( self, *, - interruption: Optional["_models.UserConversationSimulationInterruptionConfiguration"] = None, + type: Union[str, "_models.VoiceAgentAvatarType"], + character: str, + style: Optional[str] = None, + customized: Optional[bool] = None, + output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = None, + model: Optional[str] = None, + video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, + scene: Optional["_models.VoiceAgentAvatarScene"] = None, + output_audit_audio: Optional[bool] = None, ) -> None: ... @overload @@ -27535,37 +31477,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserProfileMemoryItem( - MemoryItem, discriminator="user_profile" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory item specifically containing user profile information extracted from conversations, - such as preferences, interests, and personal details. +class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An ICE server used for avatar WebRTC negotiation. - :ivar memory_id: The unique ID of the memory item. Required. - :vartype memory_id: str - :ivar updated_at: The last update time of the memory item. Required. - :vartype updated_at: ~datetime.datetime - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar content: The content of the memory. Required. - :vartype content: str - :ivar kind: The kind of the memory item. Required. User profile information extracted from - conversations. - :vartype kind: str or ~azure.ai.projects.models.USER_PROFILE + :ivar urls: Required. + :vartype urls: list[str] + :ivar username: + :vartype username: str + :ivar credential: + :vartype credential: str """ - kind: Literal[MemoryItemKind.USER_PROFILE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. User profile information extracted from conversations.""" + urls: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + urls: list[str], + username: Optional[str] = None, + credential: Optional[str] = None, ) -> None: ... @overload @@ -27577,28 +31511,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.USER_PROFILE # type: ignore -class VersionIndicator(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Version indicator determining which agent version backs the session. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VersionRefIndicator +class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar placement and motion settings. - :ivar type: The type of version indicator. Required. "version_ref" - :vartype type: str or ~azure.ai.projects.models.VersionIndicatorType + :ivar zoom: + :vartype zoom: float + :ivar position_x: + :vartype position_x: float + :ivar position_y: + :vartype position_y: float + :ivar rotation_x: + :vartype rotation_x: float + :ivar rotation_y: + :vartype rotation_y: float + :ivar rotation_z: + :vartype rotation_z: float + :ivar amplitude: + :vartype amplitude: float """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of version indicator. Required. \"version_ref\"""" + zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + position_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + position_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + rotation_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + rotation_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + rotation_z: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + amplitude: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: str, + zoom: Optional[float] = None, + position_x: Optional[float] = None, + position_y: Optional[float] = None, + rotation_x: Optional[float] = None, + rotation_y: Optional[float] = None, + rotation_z: Optional[float] = None, + amplitude: Optional[float] = None, ) -> None: ... @overload @@ -27612,28 +31564,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VersionRefIndicator( - VersionIndicator, discriminator="version_ref" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Version indicator that references a specific agent version by name. +class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video background. - :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent - version. - :vartype type: str or ~azure.ai.projects.models.VERSION_REF - :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. - :vartype agent_version: str + :ivar image_url: + :vartype image_url: str + :ivar color: + :vartype color: str """ - type: Literal[VersionIndicatorType.VERSION_REF] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent version identifier returned by the agent version APIs. Required.""" + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + color: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - agent_version: str, + image_url: Optional[str] = None, + color: Optional[str] = None, ) -> None: ... @overload @@ -27645,26 +31593,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VersionIndicatorType.VERSION_REF # type: ignore -class VersionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """VersionSelector. +class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The rectangular crop applied to avatar video. - :ivar version_selection_rules: Required. - :vartype version_selection_rules: list[~azure.ai.projects.models.VersionSelectionRule] + :ivar bottom_right: Required. + :vartype bottom_right: list[int] + :ivar top_left: Required. + :vartype top_left: list[int] """ - version_selection_rules: list["_models.VersionSelectionRule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + bottom_right: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + top_left: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload def __init__( self, *, - version_selection_rules: list["_models.VersionSelectionRule"], + bottom_right: list[int], + top_left: list[int], ) -> None: ... @overload @@ -27678,28 +31628,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAnimationConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Animation settings for a voice-agent session. +class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Avatar video encoder and presentation settings. - :ivar model_name: The animation model name. - :vartype model_name: str - :ivar outputs: The requested animation output kinds. - :vartype outputs: list[str or ~azure.ai.projects.models.VoiceAgentAnimationOutputType] + :ivar bitrate: The target video bitrate in bits per second. + :vartype bitrate: int + :ivar crop: + :vartype crop: ~azure.ai.projects.models.VoiceAgentAvatarVideoCrop + :ivar resolution: + :vartype resolution: ~azure.ai.projects.models.VoiceAgentAvatarVideoResolution + :ivar background: + :vartype background: ~azure.ai.projects.models.VoiceAgentAvatarVideoBackground + :ivar gop_size: + :vartype gop_size: int """ - model_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The animation model name.""" - outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = rest_field( + bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target video bitrate in bits per second.""" + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The requested animation output kinds.""" + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + gop_size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - model_name: Optional[str] = None, - outputs: Optional[list[Union[str, "_models.VoiceAgentAnimationOutputType"]]] = None, + bitrate: Optional[int] = None, + crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, + resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, + background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, + gop_size: Optional[int] = None, ) -> None: ... @overload @@ -27713,31 +31678,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The audio configuration for a voice agent. These values are session defaults and may be - overridden when connecting. +class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The avatar video resolution. - :ivar input: Input (microphone) audio configuration. - :vartype input: ~azure.ai.projects.models.VoiceAgentAudioInputConfig - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig + :ivar width: Required. + :vartype width: int + :ivar height: Required. + :vartype height: int """ - input: Optional["_models.VoiceAgentAudioInputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input (microphone) audio configuration.""" - output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output (agent speech) audio configuration.""" + width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - input: Optional["_models.VoiceAgentAudioInputConfig"] = None, - output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, + width: int, + height: int, ) -> None: ... @overload @@ -27751,54 +31711,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAudioInputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio configuration for a voice agent. +class VoiceAgentTurnDetectionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Turn-detection configuration for a voice agent. - :ivar format: The input audio format. - :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats - :ivar noise_reduction: Input noise reduction. Set to null to disable. - :vartype noise_reduction: ~azure.ai.projects.models.VoiceAgentNoiseReduction - :ivar turn_detection: Turn (end-of-speech) detection. Server-side turn detection is enabled by - default; set to null to disable it, in which case the client must trigger responses manually. - :vartype turn_detection: ~azure.ai.projects.models.VoiceAgentTurnDetectionConfig - :ivar echo_cancellation: Optional server-side echo cancellation settings. - :vartype echo_cancellation: ~azure.ai.projects.models.VoiceAgentEchoCancellation - :ivar transcription: Asynchronous input-audio transcription. Set to null to disable - transcription. - :vartype transcription: ~azure.ai.projects.models.VoiceAgentInputTranscription + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureSemanticVadEnTurnDetection, + VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, + VoiceAgentServerVadTurnDetection + + :ivar type: The turn-detection strategy. Required. Known values are: "server_vad", + "semantic_vad", "azure_semantic_vad", "azure_semantic_vad_en", and + "azure_semantic_vad_multilingual". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentTurnDetectionType + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool """ - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The input audio format.""" - noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input noise reduction. Set to null to disable.""" - turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Turn (end-of-speech) detection. Server-side turn detection is enabled by default; set to null - to disable it, in which case the client must trigger responses manually.""" - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional server-side echo cancellation settings.""" - transcription: Optional["_models.VoiceAgentInputTranscription"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Asynchronous input-audio transcription. Set to null to disable transcription.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The turn-detection strategy. Required. Known values are: \"server_vad\", \"semantic_vad\", + \"azure_semantic_vad\", \"azure_semantic_vad_en\", and \"azure_semantic_vad_multilingual\".""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input audio buffer is truncated automatically when speech stops.""" @overload def __init__( self, *, - format: Optional["_models.RealtimeAudioFormats"] = None, - noise_reduction: Optional["_models.VoiceAgentNoiseReduction"] = None, - turn_detection: Optional["_models.VoiceAgentTurnDetectionConfig"] = None, - echo_cancellation: Optional["_models.VoiceAgentEchoCancellation"] = None, - transcription: Optional["_models.VoiceAgentInputTranscription"] = None, + type: str, + auto_truncate: Optional[bool] = None, ) -> None: ... @overload @@ -27812,139 +31754,84 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Output audio configuration for a voice agent. - Provider-specific fields are selected by ``voice_type``: - - * `openai`: `voice` and `speed`. - * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, - `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. - * `azure-custom`: all `azure-standard` fields except `style`, plus `custom_voice_endpoint_id`. - * `azure-personal`: all `azure-standard` fields except `style`, plus `personal_voice_model`. - * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus `personal_voice_model`; the - voice name is derived from the avatar. - * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice - type. +class VoiceAgentAzureSemanticVadEnTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_en" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """English-optimized Azure semantic voice activity detection. - :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz - PCM. - :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats - :ivar voice: The voice name or identifier. Applies to ``openai``, ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``azure-realtime-native``. It does not apply to - ``avatar-voice-sync``, which derives the voice name from the avatar. - :vartype voice: str - :ivar voice_type: The voice implementation. Known values are: "openai", "azure-standard", - "azure-custom", "azure-personal", "avatar-voice-sync", and "azure-realtime-native". - :vartype voice_type: str or ~azure.ai.projects.models.VoiceType - :ivar voice_locale: The enforced BCP-47 output locale. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype voice_locale: str - :ivar speed: The numeric output speed multiplier. Applies to all known ``voice_type`` values - and defaults to 1. - :vartype speed: float - :ivar voice_temperature: The voice variation temperature. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype voice_temperature: float - :ivar custom_lexicon_url: The URL of a custom pronunciation lexicon. Applies to - ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype custom_lexicon_url: str - :ivar custom_text_normalization_url: The URL of a custom text-normalization configuration. - Applies to ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype custom_text_normalization_url: str - :ivar prefer_locales: Preferred BCP-47 locales for multilingual synthesis. Applies to - ``azure-standard``, ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``. - :vartype prefer_locales: list[str] - :ivar style: The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``. - :vartype style: str - :ivar pitch: The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``. - :vartype pitch: str - :ivar volume: The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``. - :vartype volume: str - :ivar custom_voice_endpoint_id: The Azure custom-voice deployment endpoint identifier. Applies - only when ``voice_type`` is ``azure-custom``. - :vartype custom_voice_endpoint_id: str - :ivar personal_voice_model: The Azure personal or avatar voice model. Applies only when - ``voice_type`` is ``azure-personal`` or ``avatar-voice-sync``. - :vartype personal_voice_model: str - :ivar output_audio_timestamp_types: Timestamp kinds to include with output audio. Applies to - every ``voice_type``. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.projects.models.VoiceAgentAudioTimestampType] + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar type: Required. English-optimized Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_EN + :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. + :vartype threshold: float + :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. + :vartype prefix_padding_ms: ~datetime.timedelta + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: ~datetime.timedelta + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: ~datetime.timedelta + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: ~datetime.timedelta + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar create_response: Whether a response is created automatically when speech stops. + :vartype create_response: bool + :ivar interrupt_response: Whether user speech may interrupt the agent's response. + :vartype interrupt_response: bool """ - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM.""" - voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice name or identifier. Applies to ``openai``, ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``azure-realtime-native``. It does not apply to ``avatar-voice-sync``, - which derives the voice name from the avatar.""" - voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The voice implementation. Known values are: \"openai\", \"azure-standard\", \"azure-custom\", - \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" - voice_locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The enforced BCP-47 output locale. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The numeric output speed multiplier. Applies to all known ``voice_type`` values and defaults to - 1.""" - voice_temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice variation temperature. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL of a custom pronunciation lexicon. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_text_normalization_url: Optional[str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The URL of a custom text-normalization configuration. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" - prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Preferred BCP-47 locales for multilingual synthesis. Applies to ``azure-standard``, - ``azure-custom``, ``azure-personal``, and ``avatar-voice-sync``.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice speaking style. Applies only when ``voice_type`` is ``azure-standard``.""" - pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice pitch adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice volume adjustment. Applies to ``azure-standard``, ``azure-custom``, - ``azure-personal``, and ``avatar-voice-sync``.""" - custom_voice_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure custom-voice deployment endpoint identifier. Applies only when ``voice_type`` is - ``azure-custom``.""" - personal_voice_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure personal or avatar voice model. Applies only when ``voice_type`` is - ``azure-personal`` or ``avatar-voice-sync``.""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = rest_field( + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. English-optimized Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Timestamp kinds to include with output audio. Applies to every ``voice_type``.""" + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether a response is created automatically when speech stops.""" + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user speech may interrupt the agent's response.""" @overload def __init__( self, *, - format: Optional["_models.RealtimeAudioFormats"] = None, - voice: Optional[str] = None, - voice_type: Optional[Union[str, "_models.VoiceType"]] = None, - voice_locale: Optional[str] = None, - speed: Optional[float] = None, - voice_temperature: Optional[float] = None, - custom_lexicon_url: Optional[str] = None, - custom_text_normalization_url: Optional[str] = None, - prefer_locales: Optional[list[str]] = None, - style: Optional[str] = None, - pitch: Optional[str] = None, - volume: Optional[str] = None, - custom_voice_endpoint_id: Optional[str] = None, - personal_voice_model: Optional[str] = None, - output_audio_timestamp_types: Optional[list[Union[str, "_models.VoiceAgentAudioTimestampType"]]] = None, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[datetime.timedelta] = None, + silence_duration_ms: Optional[datetime.timedelta] = None, + idle_timeout_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + remove_filler_words: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, ) -> None: ... @overload @@ -27956,74 +31843,189 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore -class VoiceAgentAvatarConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar configuration for a voice agent. These values are session defaults and may be overridden - when connecting. +class VoiceAgentAzureSemanticVadMultilingualTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_multilingual" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Multilingual Azure semantic voice activity detection. - :ivar type: The avatar type. Required. Known values are: "video_avatar" and "photo_avatar". - :vartype type: str or ~azure.ai.projects.models.VoiceAgentAvatarType - :ivar character: The avatar character identifier, e.g. 'lisa'. Required. - :vartype character: str - :ivar style: The avatar style, e.g. 'casual-sitting'. - :vartype style: str - :ivar customized: Whether the avatar is a customer-customized avatar. Defaults to false. - :vartype customized: bool - :ivar output_protocol: The transport used to deliver the avatar video stream. Known values are: - "webrtc" and "websocket". - :vartype output_protocol: str or ~azure.ai.projects.models.VoiceAgentAvatarOutputProtocol - :ivar model: The avatar model identifier. - :vartype model: str - :ivar video: Avatar video encoder and presentation settings. - :vartype video: ~azure.ai.projects.models.VoiceAgentAvatarVideoParams - :ivar scene: Avatar placement and motion settings. - :vartype scene: ~azure.ai.projects.models.VoiceAgentAvatarScene - :ivar output_audit_audio: Whether audit audio is emitted with avatar output. Defaults to false. - :vartype output_audit_audio: bool + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar type: Required. Multilingual Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_MULTILINGUAL + :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. + :vartype threshold: float + :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. + :vartype prefix_padding_ms: ~datetime.timedelta + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: ~datetime.timedelta + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: ~datetime.timedelta + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: ~datetime.timedelta + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar create_response: Whether a response is created automatically when speech stops. + :vartype create_response: bool + :ivar interrupt_response: Whether user speech may interrupt the agent's response. + :vartype interrupt_response: bool + :ivar languages: BCP-47 language codes used for speech detection. + :vartype languages: list[str] """ - type: Union[str, "_models.VoiceAgentAvatarType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Multilingual Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """The avatar type. Required. Known values are: \"video_avatar\" and \"photo_avatar\".""" - character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar character identifier, e.g. 'lisa'. Required.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar style, e.g. 'casual-sitting'.""" - customized: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the avatar is a customer-customized avatar. Defaults to false.""" - output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """The transport used to deliver the avatar video stream. Known values are: \"webrtc\" and - \"websocket\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The avatar model identifier.""" - video: Optional["_models.VoiceAgentAvatarVideoParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """Avatar video encoder and presentation settings.""" - scene: Optional["_models.VoiceAgentAvatarScene"] = rest_field( + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Avatar placement and motion settings.""" - output_audit_audio: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether audit audio is emitted with avatar output. Defaults to false.""" + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether a response is created automatically when speech stops.""" + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user speech may interrupt the agent's response.""" + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """BCP-47 language codes used for speech detection.""" @overload def __init__( self, *, - type: Union[str, "_models.VoiceAgentAvatarType"], - character: str, - style: Optional[str] = None, - customized: Optional[bool] = None, - output_protocol: Optional[Union[str, "_models.VoiceAgentAvatarOutputProtocol"]] = None, - model: Optional[str] = None, - video: Optional["_models.VoiceAgentAvatarVideoParams"] = None, - scene: Optional["_models.VoiceAgentAvatarScene"] = None, - output_audit_audio: Optional[bool] = None, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[datetime.timedelta] = None, + silence_duration_ms: Optional[datetime.timedelta] = None, + idle_timeout_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + remove_filler_words: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + languages: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore + + +class VoiceAgentAzureSemanticVadTurnDetection( + VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure semantic voice activity detection. + + :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech + stops. + :vartype auto_truncate: bool + :ivar type: Required. Azure semantic voice activity detection. + :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD + :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. + :vartype threshold: float + :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. + :vartype prefix_padding_ms: ~datetime.timedelta + :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. + :vartype silence_duration_ms: ~datetime.timedelta + :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. + :vartype idle_timeout_ms: ~datetime.timedelta + :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to + null to disable it. + :vartype end_of_utterance_detection: + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection + :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in + milliseconds. + :vartype speech_duration_ms: ~datetime.timedelta + :ivar remove_filler_words: Whether filler words are removed from transcription. + :vartype remove_filler_words: bool + :ivar create_response: Whether a response is created automatically when speech stops. + :vartype create_response: bool + :ivar interrupt_response: Whether user speech may interrupt the agent's response. + :vartype interrupt_response: bool + :ivar languages: BCP-47 language codes used for speech detection. + :vartype languages: list[str] + """ + + type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Azure semantic voice activity detection.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Activation threshold for voice activity detection, from 0 to 1.""" + prefix_padding_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Audio to include before detected speech, in milliseconds.""" + silence_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Silence required to end speech detection, in milliseconds.""" + idle_timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Maximum idle time before the detector ends the turn, in milliseconds.""" + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Semantic end-of-utterance detection configuration. Set to null to disable it.""" + speech_duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """Minimum speech duration required to trigger detection, in milliseconds.""" + remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether filler words are removed from transcription.""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether a response is created automatically when speech stops.""" + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether user speech may interrupt the agent's response.""" + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """BCP-47 language codes used for speech detection.""" + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[datetime.timedelta] = None, + silence_duration_ms: Optional[datetime.timedelta] = None, + idle_timeout_ms: Optional[datetime.timedelta] = None, + end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, + speech_duration_ms: Optional[datetime.timedelta] = None, + remove_filler_words: Optional[bool] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + languages: Optional[list[str]] = None, ) -> None: ... @overload @@ -28035,31 +32037,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore -class VoiceAgentAvatarIceServer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An ICE server used for avatar WebRTC negotiation. +class VoiceAgentBaseDefinition( + AgentDefinition, discriminator="voice" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Shared voice-agent settings; protocol-specific fields remain flat on each subtype. Creates and + updates produce immutable versions. An agent's protocol cannot change across versions. - :ivar urls: Required. - :vartype urls: list[str] - :ivar username: - :vartype username: str - :ivar credential: - :vartype credential: str + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Always voice. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar sub_protocol: Omission selects Realtime. Null and unknown values are invalid. Reads + preserve omission. Known values are: "realtime" and "live". + :vartype sub_protocol: str or ~azure.ai.projects.models.VoiceAgentSubProtocol + :ivar instructions: Frontend instructions, templated with structured_inputs. Backend + instructions belong in delegation.responses. + :vartype instructions: str + :ivar structured_inputs: Template inputs for session instructions and supported greetings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar store: Persists conversation content and audio in Foundry, not native Live recordings. + Defaults to false. + :vartype store: bool """ - urls: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + kind: Literal[AgentKind.VOICE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Always voice. Required. VOICE.""" + sub_protocol: Optional[Union[str, "_models.VoiceAgentSubProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Omission selects Realtime. Null and unknown values are invalid. Reads preserve omission. Known + values are: \"realtime\" and \"live\".""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Frontend instructions, templated with structured_inputs. Backend instructions belong in + delegation.responses.""" + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Template inputs for session instructions and supported greetings.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Persists conversation content and audio in Foundry, not native Live recordings. Defaults to + false.""" @overload def __init__( self, *, - urls: list[str], - username: Optional[str] = None, - credential: Optional[str] = None, + rai_config: Optional["_models.RaiConfig"] = None, + sub_protocol: Optional[Union[str, "_models.VoiceAgentSubProtocol"]] = None, + instructions: Optional[str] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + store: Optional[bool] = None, ) -> None: ... @overload @@ -28071,46 +32101,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = AgentKind.VOICE # type: ignore -class VoiceAgentAvatarScene(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar placement and motion settings. +class VoiceAgentClientEventRtcCallSdpCreate( + RealtimeClientEvent, discriminator="rtc.call.sdp.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``rtc.call.sdp.create`` client event: begins WebRTC signaling with an SDP offer. - :ivar zoom: - :vartype zoom: float - :ivar position_x: - :vartype position_x: float - :ivar position_y: - :vartype position_y: float - :ivar rotation_x: - :vartype rotation_x: float - :ivar rotation_y: - :vartype rotation_y: float - :ivar rotation_z: - :vartype rotation_z: float - :ivar amplitude: - :vartype amplitude: float + :ivar type: The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE. + :vartype type: str or ~azure.ai.projects.models.RTC_CALL_SDP_CREATE + :ivar event_id: An optional client-generated event identifier. + :vartype event_id: str + :ivar sdp_offer: The client's SDP offer for the WebRTC connection. Required. + :vartype sdp_offer: str + :ivar session: Optional session configuration. For an ``/agents`` endpoint the service rebuilds + it authoritatively from the persisted agent definition. + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig """ - zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - position_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - position_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - rotation_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - rotation_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - rotation_z: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - amplitude: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional client-generated event identifier.""" + sdp_offer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client's SDP offer for the WebRTC connection. Required.""" + session: Optional["_models.VoiceAgentSessionUpdateConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional session configuration. For an ``/agents`` endpoint the service rebuilds it + authoritatively from the persisted agent definition.""" @overload def __init__( self, *, - zoom: Optional[float] = None, - position_x: Optional[float] = None, - position_y: Optional[float] = None, - rotation_x: Optional[float] = None, - rotation_y: Optional[float] = None, - rotation_z: Optional[float] = None, - amplitude: Optional[float] = None, + sdp_offer: str, + event_id: Optional[str] = None, + session: Optional["_models.VoiceAgentSessionUpdateConfig"] = None, ) -> None: ... @overload @@ -28122,26 +32150,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.RTC_CALL_SDP_CREATE # type: ignore -class VoiceAgentAvatarVideoBackground(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video background. +class VoiceAgentClientEventSessionAvatarConnect( + RealtimeClientEvent, discriminator="session.avatar.connect" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The ``session.avatar.connect`` client event. - :ivar image_url: - :vartype image_url: str - :ivar color: - :vartype color: str + :ivar type: The event type. Always ``session.avatar.connect``. Required. + SESSION_AVATAR_CONNECT. + :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_CONNECT + :ivar event_id: An optional client-generated event identifier. + :vartype event_id: str + :ivar client_sdp: The client's SDP offer for avatar media negotiation. Required. + :vartype client_sdp: str """ - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - color: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type. Always ``session.avatar.connect``. Required. SESSION_AVATAR_CONNECT.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional client-generated event identifier.""" + client_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client's SDP offer for avatar media negotiation. Required.""" @overload def __init__( self, *, - image_url: Optional[str] = None, - color: Optional[str] = None, + client_sdp: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -28153,28 +32191,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.SESSION_AVATAR_CONNECT # type: ignore -class VoiceAgentAvatarVideoCrop(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The rectangular crop applied to avatar video. +class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The ``session.update`` client event. - :ivar bottom_right: Required. - :vartype bottom_right: list[int] - :ivar top_left: Required. - :vartype top_left: list[int] + :ivar event_id: Optional client-generated ID used to identify this event. This is an arbitrary + string that a client may assign. It will be passed back if there is an error with the event, + but the corresponding ``session.updated`` event will not include it. + :vartype event_id: str + :ivar type: The event type, must be ``session.update``. Required. SESSION_UPDATE. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE + :ivar session: The voice-agent session settings to update. Required. Is one of the following + types: VoiceAgentSessionUpdateConfig + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig """ - bottom_right: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - top_left: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event. This is an arbitrary string that a + client may assign. It will be passed back if there is an error with the event, but the + corresponding ``session.updated`` event will not include it.""" + type: Literal[RealtimeClientEventType.SESSION_UPDATE] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" + session: "_unions.VoiceAgentSessionUpdate" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice-agent session settings to update. Required. Is one of the following types: + VoiceAgentSessionUpdateConfig""" @overload def __init__( self, *, - bottom_right: list[int], - top_left: list[int], + type: Literal[RealtimeClientEventType.SESSION_UPDATE], + session: "_unions.VoiceAgentSessionUpdate", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -28188,43 +32240,184 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Avatar video encoder and presentation settings. +class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstring-keyword-should-match-keyword-only + """The voice agent definition. Its configuration (model, instructions, audio, tools, and optional + avatar) drives a managed speech-to-speech experience. Establish realtime voice sessions through + ``GET /agents/{agent_name}/endpoint/protocols/voice``. Every create or update produces a new + immutable version. - :ivar bitrate: The target video bitrate in bits per second. - :vartype bitrate: int - :ivar crop: - :vartype crop: ~azure.ai.projects.models.VoiceAgentAvatarVideoCrop - :ivar resolution: - :vartype resolution: ~azure.ai.projects.models.VoiceAgentAvatarVideoResolution - :ivar background: - :vartype background: ~azure.ai.projects.models.VoiceAgentAvatarVideoBackground - :ivar gop_size: - :vartype gop_size: int + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Always voice. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar instructions: Frontend instructions, templated with structured_inputs. Backend + instructions belong in delegation.responses. + :vartype instructions: str + :ivar structured_inputs: Template inputs for session instructions and supported greetings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar store: Persists conversation content and audio in Foundry, not native Live recordings. + Defaults to false. + :vartype store: bool + :ivar sub_protocol: Selects Realtime. May be omitted for legacy agents. Default value is + "realtime". + :vartype sub_protocol: str + :ivar model_type: How the model backing this voice agent is served. Required with ``model`` for + a model-backed voice agent and omitted when ``conversation_engine`` is provided. This is + independent of the architecture (realtime or cascaded), which the service derives from the + selected model. Known values are: "managed" and "self_deployed". + :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType + :ivar model: The model to use for this agent. Required with ``model_type`` for a model-backed + voice agent and omitted when ``conversation_engine`` is provided. The model must support + realtime or cascaded voice. + :vartype model: str + :ivar conversation_engine: The engine that owns conversation handling for this voice agent. + Exactly one of this property and the model-backed configuration (``model_type`` with ``model``) + must be provided. When this property is provided, ``model_type``, ``model``, ``instructions``, + ``tools``, and ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be + ``required``, because the engine owns the conversation logic. The initial implementation + supports a hosted-agent engine. + :vartype conversation_engine: ~azure.ai.projects.models.VoiceConversationEngine + :ivar greeting: Optional session-start greeting. Template mode speaks exact rendered text; + LLM-generated mode asks the session model to author the opening response and may use configured + tools. + :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig + :ivar audio: The audio configuration, including input and output formats, voice, turn + detection, noise reduction, and transcription. These values are session defaults; a client may + override supported fields when connecting. + :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig + :ivar output_modalities: The output modalities the agent produces. Defaults to ``["audio"]``. + ``animation`` and ``avatar`` are available when an avatar is configured. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type + or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar include: Additional fields to include in service outputs. + :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] + :ivar interim_response: Interim-response settings for latency and tool execution. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig + :ivar avatar: Optional avatar configuration. These values are session defaults and may be + overridden when connecting. + :vartype avatar: ~azure.ai.projects.models.VoiceAgentAvatarConfig + :ivar tools: The tools the voice agent may use. Supported tool kinds are ``function`` (executed + by the client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. + Server-side tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided + through a toolbox rather than declared directly. + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar tool_choice: How the model chooses tools for generated responses. ``none`` prevents tool + calls, ``auto`` lets the model decide, ``required`` requires at least one tool call, and a + specific function or MCP tool can be selected with an object. Defaults to ``auto``. Is one of + the following types: Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, + ToolChoiceMCP + :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or + ~azure.ai.projects.models.ToolChoiceMCP + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + :ivar subagent_config: Optional configuration for sibling Foundry text agents that this voice + agent may consult as background specialists. + :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig """ - bitrate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target video bitrate in bits per second.""" - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = rest_field( + sub_protocol: Optional[Literal["realtime"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Selects Realtime. May be omitted for legacy agents. Default value is \"realtime\".""" + model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = rest_field( + """How the model backing this voice agent is served. Required with ``model`` for a model-backed + voice agent and omitted when ``conversation_engine`` is provided. This is independent of the + architecture (realtime or cascaded), which the service derives from the selected model. Known + values are: \"managed\" and \"self_deployed\".""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for this agent. Required with ``model_type`` for a model-backed voice agent + and omitted when ``conversation_engine`` is provided. The model must support realtime or + cascaded voice.""" + conversation_engine: Optional["_models.VoiceConversationEngine"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - background: Optional["_models.VoiceAgentAvatarVideoBackground"] = rest_field( + """The engine that owns conversation handling for this voice agent. Exactly one of this property + and the model-backed configuration (``model_type`` with ``model``) must be provided. When this + property is provided, ``model_type``, ``model``, ``instructions``, ``tools``, and + ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be ``required``, because + the engine owns the conversation logic. The initial implementation supports a hosted-agent + engine.""" + greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - gop_size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional session-start greeting. Template mode speaks exact rendered text; LLM-generated mode + asks the session model to author the opening response and may use configured tools.""" + audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The audio configuration, including input and output formats, voice, turn detection, noise + reduction, and transcription. These values are session defaults; a client may override + supported fields when connecting.""" + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and + ``avatar`` are available when an avatar is configured.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional fields to include in service outputs.""" + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution.""" + avatar: Optional["_models.VoiceAgentAvatarConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional avatar configuration. These values are session defaults and may be overridden when + connecting.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The tools the voice agent may use. Supported tool kinds are ``function`` (executed by the + client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. Server-side + tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided through a + toolbox rather than declared directly.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the model chooses tools for generated responses. ``none`` prevents tool calls, ``auto`` + lets the model decide, ``required`` requires at least one tool call, and a specific function or + MCP tool can be selected with an object. Defaults to ``auto``. Is one of the following types: + Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel.""" + subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional configuration for sibling Foundry text agents that this voice agent may consult as + background specialists.""" @overload def __init__( self, *, - bitrate: Optional[int] = None, - crop: Optional["_models.VoiceAgentAvatarVideoCrop"] = None, - resolution: Optional["_models.VoiceAgentAvatarVideoResolution"] = None, - background: Optional["_models.VoiceAgentAvatarVideoBackground"] = None, - gop_size: Optional[int] = None, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + store: Optional[bool] = None, + sub_protocol: Optional[Literal["realtime"]] = None, + model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, + model: Optional[str] = None, + conversation_engine: Optional["_models.VoiceConversationEngine"] = None, + greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + audio: Optional["_models.VoiceAgentAudioConfig"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, + avatar: Optional["_models.VoiceAgentAvatarConfig"] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + parallel_tool_calls: Optional[bool] = None, + subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = None, ) -> None: ... @overload @@ -28238,26 +32431,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAvatarVideoResolution(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The avatar video resolution. +class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Server-side echo cancellation settings for input audio. - :ivar width: Required. - :vartype width: int - :ivar height: Required. - :vartype height: int + :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. + Required. Default value is "server_echo_cancellation". + :vartype type: str + :ivar reference_source: Whether reference audio comes from server playback or a client-provided + channel. Known values are: "server" and "client". + :vartype reference_source: str or + ~azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource + :ivar channels: The number of input channels. Use two interleaved channels when + ``reference_source`` is ``client``. + :vartype channels: int """ - width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["server_echo_cancellation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default + value is \"server_echo_cancellation\".""" + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether reference audio comes from server playback or a client-provided channel. Known values + are: \"server\" and \"client\".""" + channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input channels. Use two interleaved channels when ``reference_source`` is + ``client``.""" @overload def __init__( self, *, - width: int, - height: int, + reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, + channels: Optional[int] = None, ) -> None: ... @overload @@ -28269,38 +32475,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["server_echo_cancellation"] = "server_echo_cancellation" -class VoiceAgentTurnDetectionConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Turn-detection configuration for a voice agent. +class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool usable by a voice agent. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentAzureSemanticVadTurnDetection, VoiceAgentAzureSemanticVadEnTurnDetection, - VoiceAgentAzureSemanticVadMultilingualTurnDetection, VoiceAgentSemanticVadTurnDetection, - VoiceAgentServerVadTurnDetection + VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceAgentSystemTool, VoiceAgentToolboxTool - :ivar type: The turn-detection strategy. Required. Known values are: "server_vad", - "semantic_vad", "azure_semantic_vad", "azure_semantic_vad_en", and - "azure_semantic_vad_multilingual". - :vartype type: str or ~azure.ai.projects.models.VoiceAgentTurnDetectionType - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool + :ivar type: The tool kind. Required. Default value is None. + :vartype type: str """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The turn-detection strategy. Required. Known values are: \"server_vad\", \"semantic_vad\", - \"azure_semantic_vad\", \"azure_semantic_vad_en\", and \"azure_semantic_vad_multilingual\".""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input audio buffer is truncated automatically when speech stops.""" + """The tool kind. Required. Default value is None.""" @overload def __init__( self, *, type: str, - auto_truncate: Optional[bool] = None, ) -> None: ... @overload @@ -28314,181 +32510,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentAzureSemanticVadEnTurnDetection( - VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_en" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """English-optimized Azure semantic voice activity detection. - - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar type: Required. English-optimized Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_EN - :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. - :vartype threshold: float - :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. - :vartype prefix_padding_ms: ~datetime.timedelta - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: ~datetime.timedelta - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: ~datetime.timedelta - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: ~datetime.timedelta - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar create_response: Whether a response is created automatically when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether user speech may interrupt the agent's response. - :vartype interrupt_response: bool - """ - - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. English-optimized Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a response is created automatically when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user speech may interrupt the agent's response.""" - - @overload - def __init__( - self, - *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[datetime.timedelta] = None, - silence_duration_ms: Optional[datetime.timedelta] = None, - idle_timeout_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore - +class VoiceAgentSystemTool( + VoiceAgentTool, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A service-managed control that acts on the active voice session without customer code or + external authentication. -class VoiceAgentAzureSemanticVadMultilingualTurnDetection( - VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad_multilingual" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Multilingual Azure semantic voice activity detection. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentEndConversationSystemTool - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar type: Required. Multilingual Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD_MULTILINGUAL - :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. - :vartype threshold: float - :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. - :vartype prefix_padding_ms: ~datetime.timedelta - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: ~datetime.timedelta - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: ~datetime.timedelta - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: ~datetime.timedelta - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar create_response: Whether a response is created automatically when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether user speech may interrupt the agent's response. - :vartype interrupt_response: bool - :ivar languages: BCP-47 language codes used for speech detection. - :vartype languages: list[str] + :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". + :vartype type: str + :ivar name: The service-managed control action. Known values are stable; additional values may + be added over time. Required. "end_conversation" + :vartype name: str or ~azure.ai.projects.models.VoiceAgentSystemToolName + :ivar description: An optional description of the system tool. + :vartype description: str """ - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Multilingual Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a response is created automatically when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user speech may interrupt the agent's response.""" - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """BCP-47 language codes used for speech detection.""" + __mapping__: dict[str, _Model] = {} + type: Literal["system"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``system``. Required. Default value is \"system\".""" + name: str = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) + """The service-managed control action. Known values are stable; additional values may be added + over time. Required. \"end_conversation\"""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional description of the system tool.""" @overload def __init__( self, *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[datetime.timedelta] = None, - silence_duration_ms: Optional[datetime.timedelta] = None, - idle_timeout_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - languages: Optional[list[str]] = None, + name: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -28500,92 +32554,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore + self.type = "system" # type: ignore -class VoiceAgentAzureSemanticVadTurnDetection( - VoiceAgentTurnDetectionConfig, discriminator="azure_semantic_vad" +class VoiceAgentEndConversationSystemTool( + VoiceAgentSystemTool, discriminator="end_conversation" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure semantic voice activity detection. + """A service-managed control that ends the active conversation. - :ivar auto_truncate: Whether the input audio buffer is truncated automatically when speech - stops. - :vartype auto_truncate: bool - :ivar type: Required. Azure semantic voice activity detection. - :vartype type: str or ~azure.ai.projects.models.AZURE_SEMANTIC_VAD - :ivar threshold: Activation threshold for voice activity detection, from 0 to 1. - :vartype threshold: float - :ivar prefix_padding_ms: Audio to include before detected speech, in milliseconds. - :vartype prefix_padding_ms: ~datetime.timedelta - :ivar silence_duration_ms: Silence required to end speech detection, in milliseconds. - :vartype silence_duration_ms: ~datetime.timedelta - :ivar idle_timeout_ms: Maximum idle time before the detector ends the turn, in milliseconds. - :vartype idle_timeout_ms: ~datetime.timedelta - :ivar end_of_utterance_detection: Semantic end-of-utterance detection configuration. Set to - null to disable it. - :vartype end_of_utterance_detection: - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetection - :ivar speech_duration_ms: Minimum speech duration required to trigger detection, in - milliseconds. - :vartype speech_duration_ms: ~datetime.timedelta - :ivar remove_filler_words: Whether filler words are removed from transcription. - :vartype remove_filler_words: bool - :ivar create_response: Whether a response is created automatically when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether user speech may interrupt the agent's response. - :vartype interrupt_response: bool - :ivar languages: BCP-47 language codes used for speech detection. - :vartype languages: list[str] + :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". + :vartype type: str + :ivar description: An optional description of the system tool. + :vartype description: str + :ivar name: The service-managed control action. Always ``end_conversation``. Required. Ends the + active conversation. + :vartype name: str or ~azure.ai.projects.models.END_CONVERSATION """ - type: Literal[VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Azure semantic voice activity detection.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for voice activity detection, from 0 to 1.""" - prefix_padding_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Audio to include before detected speech, in milliseconds.""" - silence_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Silence required to end speech detection, in milliseconds.""" - idle_timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Maximum idle time before the detector ends the turn, in milliseconds.""" - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Semantic end-of-utterance detection configuration. Set to null to disable it.""" - speech_duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """Minimum speech duration required to trigger detection, in milliseconds.""" - remove_filler_words: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether filler words are removed from transcription.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a response is created automatically when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether user speech may interrupt the agent's response.""" - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """BCP-47 language codes used for speech detection.""" + __mapping__: dict[str, _Model] = {} + name: Literal[VoiceAgentSystemToolName.END_CONVERSATION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The service-managed control action. Always ``end_conversation``. Required. Ends the active + conversation.""" @overload def __init__( self, *, - auto_truncate: Optional[bool] = None, - threshold: Optional[float] = None, - prefix_padding_ms: Optional[datetime.timedelta] = None, - silence_duration_ms: Optional[datetime.timedelta] = None, - idle_timeout_ms: Optional[datetime.timedelta] = None, - end_of_utterance_detection: Optional["_models.VoiceAgentEndOfUtteranceDetection"] = None, - speech_duration_ms: Optional[datetime.timedelta] = None, - remove_filler_words: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, - languages: Optional[list[str]] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -28597,44 +32592,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = VoiceAgentTurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore + self.name = VoiceAgentSystemToolName.END_CONVERSATION # type: ignore -class VoiceAgentClientEventRtcCallSdpCreate( - RealtimeClientEvent, discriminator="rtc.call.sdp.create" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``rtc.call.sdp.create`` client event: begins WebRTC signaling with an SDP offer. +class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Semantic end-of-utterance detection configuration. - :ivar type: The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE. - :vartype type: str or ~azure.ai.projects.models.RTC_CALL_SDP_CREATE - :ivar event_id: An optional client-generated event identifier. - :vartype event_id: str - :ivar sdp_offer: The client's SDP offer for the WebRTC connection. Required. - :vartype sdp_offer: str - :ivar session: Optional session configuration. For an ``/agents`` endpoint the service rebuilds - it authoritatively from the persisted agent definition. - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig + :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", + "semantic_detection_v1_en", "semantic_detection_v1_multilingual", and + "smart_end_of_turn_detection". + :vartype model: str or ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel + :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", + and "default". + :vartype threshold_level: str or + ~azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel + :ivar timeout_ms: The detection timeout in milliseconds. + :vartype timeout_ms: ~datetime.timedelta """ - type: Literal[RealtimeClientEventType.RTC_CALL_SDP_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type. Always ``rtc.call.sdp.create``. Required. RTC_CALL_SDP_CREATE.""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional client-generated event identifier.""" - sdp_offer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client's SDP offer for the WebRTC connection. Required.""" - session: Optional["_models.VoiceAgentSessionUpdateConfig"] = rest_field( + model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional session configuration. For an ``/agents`` endpoint the service rebuilds it - authoritatively from the persisted agent definition.""" + """The semantic detection model. Required. Known values are: \"semantic_detection_v1\", + \"semantic_detection_v1_en\", \"semantic_detection_v1_multilingual\", and + \"smart_end_of_turn_detection\".""" + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" + timeout_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The detection timeout in milliseconds.""" @overload def __init__( self, *, - sdp_offer: str, - event_id: Optional[str] = None, - session: Optional["_models.VoiceAgentSessionUpdateConfig"] = None, + model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"], + threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, + timeout_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -28646,36 +32643,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.RTC_CALL_SDP_CREATE # type: ignore -class VoiceAgentClientEventSessionAvatarConnect( - RealtimeClientEvent, discriminator="session.avatar.connect" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The ``session.avatar.connect`` client event. +class VoiceAgentFunctionTool( + VoiceAgentTool, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A native function tool executed by the client. - :ivar type: The event type. Always ``session.avatar.connect``. Required. - SESSION_AVATAR_CONNECT. - :vartype type: str or ~azure.ai.projects.models.SESSION_AVATAR_CONNECT - :ivar event_id: An optional client-generated event identifier. - :vartype event_id: str - :ivar client_sdp: The client's SDP offer for avatar media negotiation. Required. - :vartype client_sdp: str + :ivar description: The description of the function, including guidance on when and how to call + it, and guidance about what to tell the user when calling (if anything). + :vartype description: str + :ivar parameters: Parameters of the function in JSON Schema. + :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar name: The function name. Required. + :vartype name: str """ - type: Literal[RealtimeClientEventType.SESSION_AVATAR_CONNECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type. Always ``session.avatar.connect``. Required. SESSION_AVATAR_CONNECT.""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional client-generated event identifier.""" - client_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client's SDP offer for avatar media negotiation. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the function, including guidance on when and how to call it, and guidance + about what to tell the user when calling (if anything).""" + parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters of the function in JSON Schema.""" + type: Literal["function"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The function name. Required.""" @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = None, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -28687,42 +32691,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.SESSION_AVATAR_CONNECT # type: ignore + self.type = "function" # type: ignore -class VoiceAgentClientEventSessionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The ``session.update`` client event. +class VoiceAgentGreetingConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Session-start greeting configuration for a voice agent. - :ivar event_id: Optional client-generated ID used to identify this event. This is an arbitrary - string that a client may assign. It will be passed back if there is an error with the event, - but the corresponding ``session.updated`` event will not include it. - :vartype event_id: str - :ivar type: The event type, must be ``session.update``. Required. SESSION_UPDATE. - :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE - :ivar session: The voice-agent session settings to update. Required. Is one of the following - types: VoiceAgentSessionUpdateConfig - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionUpdateConfig + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentTemplateGreetingConfig + + :ivar type: The greeting mode. Required. Default value is None. + :vartype type: str """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event. This is an arbitrary string that a - client may assign. It will be passed back if there is an error with the event, but the - corresponding ``session.updated`` event will not include it.""" - type: Literal[RealtimeClientEventType.SESSION_UPDATE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" - session: "_unions.VoiceAgentSessionUpdate" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice-agent session settings to update. Required. Is one of the following types: - VoiceAgentSessionUpdateConfig""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The greeting mode. Required. Default value is None.""" @overload def __init__( self, *, - type: Literal[RealtimeClientEventType.SESSION_UPDATE], - session: "_unions.VoiceAgentSessionUpdate", - event_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -28736,206 +32726,93 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceAgentDefinition( - AgentDefinition, discriminator="voice" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The voice agent definition. Its configuration (model, instructions, audio, tools, and optional - avatar) drives a managed speech-to-speech experience. Establish realtime voice sessions through - ``GET /agents/{agent_name}/endpoint/protocols/voice``. Every create or update produces a new - immutable version. +class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Asynchronous input-audio transcription configuration. Extends the OpenAI Realtime transcription + options with the Azure and MAI transcription models, custom speech models, and phrase hints. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: The kind discriminator for a voice agent definition. Always ``voice``. Required. - VOICE. - :vartype kind: str or ~azure.ai.projects.models.VOICE - :ivar model_type: How the model backing this voice agent is served. Required with ``model`` for - a model-backed voice agent and omitted when ``conversation_engine`` is provided. This is - independent of the architecture (realtime or cascaded), which the service derives from the - selected model. Known values are: "managed" and "self_deployed". - :vartype model_type: str or ~azure.ai.projects.models.VoiceModelType - :ivar model: The model to use for this agent. Required with ``model_type`` for a model-backed - voice agent and omitted when ``conversation_engine`` is provided. The model must support - realtime or cascaded voice. - :vartype model: str - :ivar conversation_engine: The engine that owns conversation handling for this voice agent. - Exactly one of this property and the model-backed configuration (``model_type`` with ``model``) - must be provided. When this property is provided, ``model_type``, ``model``, ``instructions``, - ``tools``, and ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be - ``required``, because the engine owns the conversation logic. The initial implementation - supports a hosted-agent engine. - :vartype conversation_engine: ~azure.ai.projects.models.VoiceConversationEngine - :ivar instructions: A system (or developer) message inserted into the model's context. Supports - template substitution via ``structured_inputs``, rendered per session before the live session - starts. - :vartype instructions: str - :ivar greeting: Optional session-start greeting. Template mode speaks exact rendered text; - LLM-generated mode asks the session model to author the opening response and may use configured - tools. - :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig - :ivar audio: The audio configuration, including input and output formats, voice, turn - detection, noise reduction, and transcription. These values are session defaults; a client may - override supported fields when connecting. - :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig - :ivar output_modalities: The output modalities the agent produces. Defaults to ``["audio"]``. - ``animation`` and ``avatar`` are available when an avatar is configured. - :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] - :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type - or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar include: Additional fields to include in service outputs. - :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] - :ivar interim_response: Interim-response settings for latency and tool execution. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig - :ivar avatar: Optional avatar configuration. These values are session defaults and may be - overridden when connecting. - :vartype avatar: ~azure.ai.projects.models.VoiceAgentAvatarConfig - :ivar tools: The tools the voice agent may use. Supported tool kinds are ``function`` (executed - by the client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. - Server-side tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided - through a toolbox rather than declared directly. - :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] - :ivar tool_choice: How the model chooses tools for generated responses. ``none`` prevents tool - calls, ``auto`` lets the model decide, ``required`` requires at least one tool call, and a - specific function or MCP tool can be selected with an object. Defaults to ``auto``. Is one of - the following types: Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, - ToolChoiceMCP - :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or - ~azure.ai.projects.models.ToolChoiceMCP - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - :ivar structured_inputs: Set of structured inputs that participate in prompt template - substitution, rendered per session before the live session starts. - :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] - :ivar subagent_config: Optional configuration for sibling Foundry text agents that this voice - agent may consult as background specialists. - :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig - :ivar store: Whether conversations with this agent are persisted. A single, all-or-nothing - persistence switch that defaults to ``false`` (privacy-safe: off by default). When ``true``, - Foundry persists the full conversation — the transcript/event timeline and raw audio. When - ``false``, nothing is persisted and no conversation is surfaced. There is no separate - audio-logging control; audio is persisted only as part of this switch. Latency/performance - telemetry (e.g. time-to-first-audio, inter-token latency, interruption) is observability-only - (customer trace / App Insights) and is not part of the persisted conversation content. - :vartype store: bool + :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 + `_ (e.g. ``en``) format will improve + accuracy and latency. + :vartype language: str + :ivar languages: Possible languages of the input audio, in `ISO-639-1 + `_ format. Supported by + ``gpt-transcribe`` and ``gpt-live-transcribe``. + :vartype languages: list[str] + :ivar keywords: Words or phrases to guide transcription of the input audio. Supported by + ``gpt-transcribe`` and ``gpt-live-transcribe``. + :vartype keywords: list[str] + :ivar prompt: An optional text to guide the model's style or continue a previous audio segment. + For ``whisper-1``, the `prompt is a list of keywords + `_. For + ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free + text string, for example "expect words related to technology". Prompt is not supported with + ``gpt-realtime-whisper`` in GA Realtime sessions. + :vartype prompt: str + :ivar delay: Controls how long the model waits before emitting transcription text. Higher + values can improve transcription accuracy at the cost of latency. Only supported with + ``gpt-realtime-whisper`` in GA Realtime sessions. Is one of the following types: + Literal["minimal"], Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] + :vartype delay: str or str or str or str or str + :ivar model: The transcription model identifier. Configure customer custom speech deployments + in ``custom_speech``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", + "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-transcribe-diarize", "gpt-transcribe", + "gpt-live-transcribe", "mai-transcribe", and "azure-speech". + :vartype model: str or ~azure.ai.projects.models.VoiceAgentInputTranscriptionModel + :ivar custom_speech: Optional customer custom speech deployment configuration, keyed by locale. + :vartype custom_speech: dict[str, str] + :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. + :vartype phrase_list: list[str] """ - kind: Literal[AgentKind.VOICE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind discriminator for a voice agent definition. Always ``voice``. Required. VOICE.""" - model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model backing this voice agent is served. Required with ``model`` for a model-backed - voice agent and omitted when ``conversation_engine`` is provided. This is independent of the - architecture (realtime or cascaded), which the service derives from the selected model. Known - values are: \"managed\" and \"self_deployed\".""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to use for this agent. Required with ``model_type`` for a model-backed voice agent - and omitted when ``conversation_engine`` is provided. The model must support realtime or - cascaded voice.""" - conversation_engine: Optional["_models.VoiceConversationEngine"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The engine that owns conversation handling for this voice agent. Exactly one of this property - and the model-backed configuration (``model_type`` with ``model``) must be provided. When this - property is provided, ``model_type``, ``model``, ``instructions``, ``tools``, and - ``tool_choice`` must be omitted, and ``greeting.tool_choice`` cannot be ``required``, because - the engine owns the conversation logic. The initial implementation supports a hosted-agent - engine.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A system (or developer) message inserted into the model's context. Supports template - substitution via ``structured_inputs``, rendered per session before the live session starts.""" - greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional session-start greeting. Template mode speaks exact rendered text; LLM-generated mode - asks the session model to author the opening response and may use configured tools.""" - audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio configuration, including input and output formats, voice, turn detection, noise - reduction, and transcription. These values are session defaults; a client may override - supported fields when connecting.""" - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output modalities the agent produces. Defaults to ``[\"audio\"]``. ``animation`` and - ``avatar`` are available when an avatar is configured.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional fields to include in service outputs.""" - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Interim-response settings for latency and tool execution.""" - avatar: Optional["_models.VoiceAgentAvatarConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional avatar configuration. These values are session defaults and may be overridden when - connecting.""" - tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The tools the voice agent may use. Supported tool kinds are ``function`` (executed by the - client), ``mcp``, ``system`` (service-managed session controls), and ``toolbox``. Server-side - tools such as ``web_search``, ``azure_ai_search``, and ``openapi`` are provided through a - toolbox rather than declared directly.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model chooses tools for generated responses. ``none`` prevents tool calls, ``auto`` - lets the model decide, ``required`` requires at least one tool call, and a specific function or - MCP tool can be selected with an object. Defaults to ``auto``. Is one of the following types: - Literal[\"none\"], Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the model may call multiple tools in parallel.""" - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language of the input audio. Supplying the input language in `ISO-639-1 + `_ (e.g. ``en``) format will improve + accuracy and latency.""" + languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Possible languages of the input audio, in `ISO-639-1 + `_ format. Supported by + ``gpt-transcribe`` and ``gpt-live-transcribe``.""" + keywords: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Words or phrases to guide transcription of the input audio. Supported by ``gpt-transcribe`` and + ``gpt-live-transcribe``.""" + prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional text to guide the model's style or continue a previous audio segment. For + ``whisper-1``, the `prompt is a list of keywords + `_. For + ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free + text string, for example \"expect words related to technology\". Prompt is not supported with + ``gpt-realtime-whisper`` in GA Realtime sessions.""" + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Set of structured inputs that participate in prompt template substitution, rendered per session - before the live session starts.""" - subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = rest_field( + """Controls how long the model waits before emitting transcription text. Higher values can improve + transcription accuracy at the cost of latency. Only supported with ``gpt-realtime-whisper`` in + GA Realtime sessions. Is one of the following types: Literal[\"minimal\"], Literal[\"low\"], + Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" + model: Union[str, "_models.VoiceAgentInputTranscriptionModel"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional configuration for sibling Foundry text agents that this voice agent may consult as - background specialists.""" - store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether conversations with this agent are persisted. A single, all-or-nothing persistence - switch that defaults to ``false`` (privacy-safe: off by default). When ``true``, Foundry - persists the full conversation — the transcript/event timeline and raw audio. When ``false``, - nothing is persisted and no conversation is surfaced. There is no separate audio-logging - control; audio is persisted only as part of this switch. Latency/performance telemetry (e.g. - time-to-first-audio, inter-token latency, interruption) is observability-only (customer trace / - App Insights) and is not part of the persisted conversation content.""" + """The transcription model identifier. Configure customer custom speech deployments in + ``custom_speech``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", + \"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\", \"gpt-4o-transcribe-diarize\", + \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", and \"azure-speech\".""" + custom_speech: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional customer custom speech deployment configuration, keyed by locale.""" + phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional phrase hints that bias recognition toward domain terms.""" @overload def __init__( self, *, - rai_config: Optional["_models.RaiConfig"] = None, - model_type: Optional[Union[str, "_models.VoiceModelType"]] = None, - model: Optional[str] = None, - conversation_engine: Optional["_models.VoiceConversationEngine"] = None, - instructions: Optional[str] = None, - greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, - audio: Optional["_models.VoiceAgentAudioConfig"] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, - avatar: Optional["_models.VoiceAgentAvatarConfig"] = None, - tools: Optional[list["_models.VoiceAgentTool"]] = None, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, - parallel_tool_calls: Optional[bool] = None, - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, - subagent_config: Optional["_models.VoiceAgentSubagentConfig"] = None, - store: Optional[bool] = None, + model: Union[str, "_models.VoiceAgentInputTranscriptionModel"], + language: Optional[str] = None, + languages: Optional[list[str]] = None, + keywords: Optional[list[str]] = None, + prompt: Optional[str] = None, + delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = None, + custom_speech: Optional[dict[str, str]] = None, + phrase_list: Optional[list[str]] = None, ) -> None: ... @overload @@ -28947,42 +32824,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.VOICE # type: ignore -class VoiceAgentEchoCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Server-side echo cancellation settings for input audio. +class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Fields shared by interim-response configurations. - :ivar type: The echo cancellation implementation. Always ``server_echo_cancellation``. - Required. Default value is "server_echo_cancellation". + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig + + :ivar type: The interim-response implementation. Required. Default value is None. :vartype type: str - :ivar reference_source: Whether reference audio comes from server playback or a client-provided - channel. Known values are: "server" and "client". - :vartype reference_source: str or - ~azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource - :ivar channels: The number of input channels. Use two interleaved channels when - ``reference_source`` is ``client``. - :vartype channels: int + :ivar triggers: Conditions that may trigger one interim response. + :vartype triggers: list[str or ~azure.ai.projects.models.VoiceAgentInterimResponseTrigger] + :ivar latency_threshold_ms: The latency threshold in milliseconds. + :vartype latency_threshold_ms: ~datetime.timedelta """ - type: Literal["server_echo_cancellation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The echo cancellation implementation. Always ``server_echo_cancellation``. Required. Default - value is \"server_echo_cancellation\".""" - reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = rest_field( + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The interim-response implementation. Required. Default value is None.""" + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Whether reference audio comes from server playback or a client-provided channel. Known values - are: \"server\" and \"client\".""" - channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of input channels. Use two interleaved channels when ``reference_source`` is - ``client``.""" + """Conditions that may trigger one interim response.""" + latency_threshold_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The latency threshold in milliseconds.""" @overload def __init__( self, *, - reference_source: Optional[Union[str, "_models.VoiceAgentEchoCancellationReferenceSource"]] = None, - channels: Optional[int] = None, + type: str, + triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -28994,28 +32870,320 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["server_echo_cancellation"] = "server_echo_cancellation" -class VoiceAgentTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool usable by a voice agent. +class VoiceAgentLiveConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored speech segment or delegation. Speech segments are not native turns or proof of + playback; delegation results are separate from spoken transcripts. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentFunctionTool, VoiceAgentMcpTool, VoiceAgentSystemTool, VoiceAgentToolboxTool - - :ivar type: The tool kind. Required. Default value is None. - :vartype type: str + VoiceAgentLiveDelegationConversationItem, VoiceAgentLiveInputConversationItem, + VoiceAgentLiveOutputConversationItem + + :ivar type: The persisted item kind. Required. Known values are: "input", "output", and + "delegation". + :vartype type: str or ~azure.ai.projects.models.VoiceAgentLiveConversationItemType + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The tool kind. Required. Default value is None.""" + """The persisted item kind. Required. Known values are: \"input\", \"output\", and \"delegation\".""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their native + value. Required.""" + + @overload + def __init__( + self, + *, + type: str, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentLiveDelegationConversationItem( + VoiceAgentLiveConversationItem, discriminator="delegation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored delegation using native fields with Foundry-specific targets. Its id is the native + delegation ID. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + VoiceAgentLiveClientDelegationConversationItem, + VoiceAgentLiveFoundryManagedAgentDelegationItem, + VoiceAgentLiveResponsesDelegationConversationItem + + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar target: The configured delegation owner. Required. Known values are: "responses", + "client", and "foundry_managed_agent". + :vartype target: str or ~azure.ai.projects.models.VoiceAgentLiveDelegationTarget + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + """ + + __mapping__: dict[str, _Model] = {} + type: Literal[VoiceAgentLiveConversationItemType.DELEGATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, always ``delegation``. Required. DELEGATION.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Responses API response associated with a Responses delegation. Omitted for client + delegations.""" + target: str = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) + """The configured delegation owner. Required. Known values are: \"responses\", \"client\", and + \"foundry_managed_agent\".""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Observed delegation creation time, in Unix seconds. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + target: str, + created_at: datetime.datetime, + response_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = VoiceAgentLiveConversationItemType.DELEGATION # type: ignore + + +class VoiceAgentLiveClientDelegationConversationItem( + VoiceAgentLiveDelegationConversationItem, discriminator="client" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Results supplied by the application for client delegation. + + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + :ivar target: Required. CLIENT. + :vartype target: str or ~azure.ai.projects.models.CLIENT + :ivar commentary: Guidance for Live to communicate to the user, when accepted. + :vartype commentary: str + :ivar thinking: Accepted background context, not private reasoning or a request to speak. + :vartype thinking: str + """ + + __mapping__: dict[str, _Model] = {} + target: Literal[VoiceAgentLiveDelegationTarget.CLIENT] = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CLIENT.""" + commentary: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Guidance for Live to communicate to the user, when accepted.""" + thinking: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Accepted background context, not private reasoning or a request to speak.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + response_id: Optional[str] = None, + commentary: Optional[str] = None, + thinking: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.target = VoiceAgentLiveDelegationTarget.CLIENT # type: ignore + + +class VoiceAgentLiveConversation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Live session persisted when effective store is true. Uses voice-conversation lifecycle and + retention; items are retrieved separately. + + :ivar id: The unique id of the conversation. Required. + :vartype id: str + :ivar object: The object type. Always ``voice.conversation``. Required. Default value is + "voice.conversation". + :vartype object: str + :ivar status: The lifecycle status of the conversation. Required. Known values are: + "in_progress", "completed", and "failed". + :vartype status: str or ~azure.ai.projects.models.VoiceConversationStatus + :ivar created_at: The Unix timestamp (in seconds) for when the conversation was created. + Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The Unix timestamp (in seconds) for when session and persistence + finalization reached the terminal ``completed`` or ``failed`` status. Absent while ``status`` + is ``in_progress``. + :vartype completed_at: ~datetime.datetime + :ivar metadata: A set of key-value pairs attached to the conversation. + :vartype metadata: dict[str, str] + :ivar last_error: The terminal error that prevented persistence finalization. Present only when + ``status`` is ``failed``. + :vartype last_error: ~azure.ai.projects.models.ApiError + :ivar usage: Cumulative Live audio usage, excluding delegated-model tokens. May be absent after + abnormal close. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique id of the conversation. Required.""" + object: Literal["voice.conversation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``voice.conversation``. Required. Default value is + \"voice.conversation\".""" + status: Union[str, "_models.VoiceConversationStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status of the conversation. Required. Known values are: \"in_progress\", + \"completed\", and \"failed\".""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the conversation was created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when session and persistence finalization reached the + terminal ``completed`` or ``failed`` status. Absent while ``status`` is ``in_progress``.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A set of key-value pairs attached to the conversation.""" + last_error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The terminal error that prevented persistence finalization. Present only when ``status`` is + ``failed``.""" + usage: Optional["_models.LiveSessionUsage"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cumulative Live audio usage, excluding delegated-model tokens. May be absent after abnormal + close.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Union[str, "_models.VoiceConversationStatus"], + created_at: datetime.datetime, + completed_at: Optional[datetime.datetime] = None, + metadata: Optional[dict[str, str]] = None, + last_error: Optional["_models.ApiError"] = None, + usage: Optional["_models.LiveSessionUsage"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.object: Literal["voice.conversation"] = "voice.conversation" + + +class VoiceAgentLiveDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Live voice agent definition. Its configuration (model, instructions, audio, and delegation) + drives a managed speech-to-speech experience using a Foundry GPT Live deployment. Establish + Live voice sessions through ``GET + /agents/{agent_name}/endpoint/protocols/voice/live/sessions``. Every create or update produces + a new immutable version. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Always voice. Required. VOICE. + :vartype kind: str or ~azure.ai.projects.models.VOICE + :ivar instructions: Frontend instructions, templated with structured_inputs. Backend + instructions belong in delegation.responses. + :vartype instructions: str + :ivar structured_inputs: Template inputs for session instructions and supported greetings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar store: Persists conversation content and audio in Foundry, not native Live recordings. + Defaults to false. + :vartype store: bool + :ivar sub_protocol: Selects the Live protocol. Required. Default value is "live". + :vartype sub_protocol: str + :ivar model_type: Uses a Foundry model deployment. Required. Default value is "self_deployed". + :vartype model_type: str + :ivar model: The GPT Live deployment name. Required. + :vartype model: str + :ivar greeting: Template-only startup greeting, rendered with session structured inputs. + Foundry-only; not sent in native Live settings. + :vartype greeting: ~azure.ai.projects.models.VoiceAgentTemplateGreetingConfig + :ivar audio: Startup audio formats and output voice. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar delegation: Delegation settings. Omit for client mode. responses.model is a backend + deployment name in the Live resource, not a model catalog ID. Is one of the following types: + LiveClientDelegationParam, LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam or + ~azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation + """ + + sub_protocol: Literal["live"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Selects the Live protocol. Required. Default value is \"live\".""" + model_type: Literal["self_deployed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Uses a Foundry model deployment. Required. Default value is \"self_deployed\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The GPT Live deployment name. Required.""" + greeting: Optional["_models.VoiceAgentTemplateGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Template-only startup greeting, rendered with session structured inputs. Foundry-only; not sent + in native Live settings.""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup audio formats and output voice.""" + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Delegation settings. Omit for client mode. responses.model is a backend deployment name in the + Live resource, not a model catalog ID. Is one of the following types: + LiveClientDelegationParam, LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation""" @overload def __init__( self, *, - type: str, + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + instructions: Optional[str] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + store: Optional[bool] = None, + greeting: Optional["_models.VoiceAgentTemplateGreetingConfig"] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = None, ) -> None: ... @overload @@ -29027,41 +33195,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.sub_protocol: Literal["live"] = "live" + self.model_type: Literal["self_deployed"] = "self_deployed" -class VoiceAgentSystemTool( - VoiceAgentTool, discriminator="system" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A service-managed control that acts on the active voice session without customer code or - external authentication. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentEndConversationSystemTool +class VoiceAgentLiveDelegationResultItem1(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentLiveDelegationResultItem1. - :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". - :vartype type: str - :ivar name: The service-managed control action. Known values are stable; additional values may - be added over time. Required. "end_conversation" - :vartype name: str or ~azure.ai.projects.models.VoiceAgentSystemToolName - :ivar description: An optional description of the system tool. - :vartype description: str + :ivar commentary: Guidance for Live to communicate to the user. + :vartype commentary: str + :ivar thinking: Background context, not private reasoning or a request to speak. Required. + :vartype thinking: str """ - __mapping__: dict[str, _Model] = {} - type: Literal["system"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``system``. Required. Default value is \"system\".""" - name: str = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) - """The service-managed control action. Known values are stable; additional values may be added - over time. Required. \"end_conversation\"""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional description of the system tool.""" + commentary: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Guidance for Live to communicate to the user.""" + thinking: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Background context, not private reasoning or a request to speak. Required.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, + thinking: str, + commentary: Optional[str] = None, ) -> None: ... @overload @@ -29073,33 +33230,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "system" # type: ignore -class VoiceAgentEndConversationSystemTool( - VoiceAgentSystemTool, discriminator="end_conversation" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A service-managed control that ends the active conversation. +class VoiceAgentLiveDelegationResultItem2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """VoiceAgentLiveDelegationResultItem2. - :ivar type: The type of the tool. Always ``system``. Required. Default value is "system". - :vartype type: str - :ivar description: An optional description of the system tool. - :vartype description: str - :ivar name: The service-managed control action. Always ``end_conversation``. Required. Ends the - active conversation. - :vartype name: str or ~azure.ai.projects.models.END_CONVERSATION + :ivar commentary: Guidance for Live to communicate to the user. Required. + :vartype commentary: str + :ivar thinking: Background context, not private reasoning or a request to speak. + :vartype thinking: str """ - __mapping__: dict[str, _Model] = {} - name: Literal[VoiceAgentSystemToolName.END_CONVERSATION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The service-managed control action. Always ``end_conversation``. Required. Ends the active - conversation.""" + commentary: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Guidance for Live to communicate to the user. Required.""" + thinking: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Background context, not private reasoning or a request to speak.""" @overload def __init__( self, *, - description: Optional[str] = None, + commentary: str, + thinking: Optional[str] = None, ) -> None: ... @overload @@ -29111,46 +33263,85 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.name = VoiceAgentSystemToolName.END_CONVERSATION # type: ignore -class VoiceAgentEndOfUtteranceDetection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Semantic end-of-utterance detection configuration. +class VoiceAgentLiveFoundryManagedAgentDelegationItem( + VoiceAgentLiveDelegationConversationItem, discriminator="foundry_managed_agent" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Stored prompt-agent delegation state and accepted results. - :ivar model: The semantic detection model. Required. Known values are: "semantic_detection_v1", - "semantic_detection_v1_en", "semantic_detection_v1_multilingual", and - "smart_end_of_turn_detection". - :vartype model: str or ~azure.ai.projects.models.VoiceAgentEndOfUtteranceDetectionModel - :ivar threshold_level: The sensitivity threshold. Known values are: "low", "medium", "high", - and "default". - :vartype threshold_level: str or - ~azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel - :ivar timeout_ms: The detection timeout in milliseconds. - :vartype timeout_ms: ~datetime.timedelta + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + :ivar target: Required. FOUNDRY_MANAGED_AGENT. + :vartype target: str or ~azure.ai.projects.models.FOUNDRY_MANAGED_AGENT + :ivar agent_name: Target agent name in the same project. Required. + :vartype agent_name: str + :ivar agent_version: Target version pinned at connection start. Required. + :vartype agent_version: str + :ivar offset_ms: Native delegation offset from session start, in milliseconds. Required. + :vartype offset_ms: int + :ivar backend_conversation_id: Backend conversation ID, distinct from the voice conversation + and Live session IDs. + :vartype backend_conversation_id: str + :ivar output: Accepted guidance in order; empty until a result is accepted. Entries have no + individual IDs, are noncumulative, and are independent of backend output_index. Partial results + survive failure or cancellation. Required. + :vartype output: list[~azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2 or + ~azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1] + :ivar delegation_context: Task context sent to the target agent, not the full request body. + :vartype delegation_context: str + :ivar status: The persisted delegation outcome. Required. Known values are: "in_progress", + "completed", "failed", "incomplete", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.VoiceAgentLiveDelegationStatus """ - model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"] = rest_field( + __mapping__: dict[str, _Model] = {} + target: Literal[VoiceAgentLiveDelegationTarget.FOUNDRY_MANAGED_AGENT] = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FOUNDRY_MANAGED_AGENT.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target agent name in the same project. Required.""" + agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target version pinned at connection start. Required.""" + offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Native delegation offset from session start, in milliseconds. Required.""" + backend_conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Backend conversation ID, distinct from the voice conversation and Live session IDs.""" + output: list["_unions.VoiceAgentLiveDelegationResultItem"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The semantic detection model. Required. Known values are: \"semantic_detection_v1\", - \"semantic_detection_v1_en\", \"semantic_detection_v1_multilingual\", and - \"smart_end_of_turn_detection\".""" - threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = rest_field( + """Accepted guidance in order; empty until a result is accepted. Entries have no individual IDs, + are noncumulative, and are independent of backend output_index. Partial results survive failure + or cancellation. Required.""" + delegation_context: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Task context sent to the target agent, not the full request body.""" + status: Union[str, "_models.VoiceAgentLiveDelegationStatus"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The sensitivity threshold. Known values are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The detection timeout in milliseconds.""" + """The persisted delegation outcome. Required. Known values are: \"in_progress\", \"completed\", + \"failed\", \"incomplete\", and \"cancelled\".""" @overload def __init__( self, *, - model: Union[str, "_models.VoiceAgentEndOfUtteranceDetectionModel"], - threshold_level: Optional[Union[str, "_models.VoiceAgentEndOfUtteranceThresholdLevel"]] = None, - timeout_ms: Optional[datetime.timedelta] = None, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + agent_name: str, + agent_version: str, + offset_ms: int, + output: list["_unions.VoiceAgentLiveDelegationResultItem"], + status: Union[str, "_models.VoiceAgentLiveDelegationStatus"], + response_id: Optional[str] = None, + backend_conversation_id: Optional[str] = None, + delegation_context: Optional[str] = None, ) -> None: ... @overload @@ -29162,43 +33353,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.target = VoiceAgentLiveDelegationTarget.FOUNDRY_MANAGED_AGENT # type: ignore -class VoiceAgentFunctionTool( - VoiceAgentTool, discriminator="function" +class VoiceAgentLiveInputConversationItem( + VoiceAgentLiveConversationItem, discriminator="input" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A native function tool executed by the client. + """A stored user speech segment. - :ivar description: The description of the function, including guidance on when and how to call - it, and guidance about what to tell the user when calling (if anything). - :vartype description: str - :ivar parameters: Parameters of the function in JSON Schema. - :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters - :ivar type: Required. Default value is "function". - :vartype type: str - :ivar name: The function name. Required. - :vartype name: str + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: Required. INPUT. + :vartype type: str or ~azure.ai.projects.models.INPUT + :ivar transcription: Captured user transcription, when available. + :vartype transcription: str + :ivar audio: Captured audio metadata; audio.item_id matches this item's id. + :vartype audio: ~azure.ai.projects.models.VoiceAudioItem """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the function, including guidance on when and how to call it, and guidance - about what to tell the user when calling (if anything).""" - parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Parameters of the function in JSON Schema.""" - type: Literal["function"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"function\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The function name. Required.""" + type: Literal[VoiceAgentLiveConversationItemType.INPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. INPUT.""" + transcription: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured user transcription, when available.""" + audio: Optional["_models.VoiceAudioItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured audio metadata; audio.item_id matches this item's id.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, + id: str, # pylint: disable=redefined-builtin + transcription: Optional[str] = None, + audio: Optional["_models.VoiceAudioItem"] = None, ) -> None: ... @overload @@ -29210,28 +33397,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "function" # type: ignore - + self.type = VoiceAgentLiveConversationItemType.INPUT # type: ignore -class VoiceAgentGreetingConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Session-start greeting configuration for a voice agent. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentTemplateGreetingConfig +class VoiceAgentLiveManagedAgentDelegation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Delegates to a same-project prompt agent using native client delegation. Requires [thinking] + and/or [commentary] output sections. - :ivar type: The greeting mode. Required. Default value is None. + :ivar type: Canonical delegation type; legacy managed_prompt_agent values are returned as + foundry_managed_agent. Required. Default value is "foundry_managed_agent". :vartype type: str + :ivar agent_name: Name of a prompt agent in the same project. Required. + :vartype agent_name: str + :ivar agent_version: Agent version, pinned per connection. Omit to select the active version. + :vartype agent_version: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The greeting mode. Required. Default value is None.""" + type: Literal["foundry_managed_agent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Canonical delegation type; legacy managed_prompt_agent values are returned as + foundry_managed_agent. Required. Default value is \"foundry_managed_agent\".""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of a prompt agent in the same project. Required.""" + agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Agent version, pinned per connection. Omit to select the active version.""" @overload def __init__( self, *, - type: str, + agent_name: str, + agent_version: Optional[str] = None, ) -> None: ... @overload @@ -29243,93 +33438,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["foundry_managed_agent"] = "foundry_managed_agent" -class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Asynchronous input-audio transcription configuration. Extends the OpenAI Realtime transcription - options with the Azure and MAI transcription models, custom speech models, and phrase hints. +class VoiceAgentLiveOutputConversationItem( + VoiceAgentLiveConversationItem, discriminator="output" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A stored assistant speech segment. - :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 - `_ (e.g. ``en``) format will improve - accuracy and latency. - :vartype language: str - :ivar languages: Possible languages of the input audio, in `ISO-639-1 - `_ format. Supported by - ``gpt-transcribe`` and ``gpt-live-transcribe``. - :vartype languages: list[str] - :ivar keywords: Words or phrases to guide transcription of the input audio. Supported by - ``gpt-transcribe`` and ``gpt-live-transcribe``. - :vartype keywords: list[str] - :ivar prompt: An optional text to guide the model's style or continue a previous audio segment. - For ``whisper-1``, the `prompt is a list of keywords `_. - For ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a - free text string, for example "expect words related to technology". Prompt is not supported - with ``gpt-realtime-whisper`` in GA Realtime sessions. - :vartype prompt: str - :ivar delay: Controls how long the model waits before emitting transcription text. Higher - values can improve transcription accuracy at the cost of latency. Only supported with - ``gpt-realtime-whisper`` in GA Realtime sessions. Is one of the following types: - Literal["minimal"], Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] - :vartype delay: str or str or str or str or str - :ivar model: The transcription model identifier. Configure customer custom speech deployments - in ``custom_speech``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", - "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-transcribe-diarize", "gpt-transcribe", - "gpt-live-transcribe", "mai-transcribe", and "azure-speech". - :vartype model: str or ~azure.ai.projects.models.VoiceAgentInputTranscriptionModel - :ivar custom_speech: Optional customer custom speech deployment configuration, keyed by locale. - :vartype custom_speech: dict[str, str] - :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. - :vartype phrase_list: list[str] + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: Required. OUTPUT. + :vartype type: str or ~azure.ai.projects.models.OUTPUT + :ivar transcription: Captured assistant transcription, not backend output or commentary + guidance. + :vartype transcription: str + :ivar audio: Captured audio metadata; audio.item_id matches this item's id. + :vartype audio: ~azure.ai.projects.models.VoiceAudioItem """ - language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language of the input audio. Supplying the input language in `ISO-639-1 - `_ (e.g. ``en``) format will improve - accuracy and latency.""" - languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Possible languages of the input audio, in `ISO-639-1 - `_ format. Supported by - ``gpt-transcribe`` and ``gpt-live-transcribe``.""" - keywords: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Words or phrases to guide transcription of the input audio. Supported by ``gpt-transcribe`` and - ``gpt-live-transcribe``.""" - prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional text to guide the model's style or continue a previous audio segment. For - ``whisper-1``, the `prompt is a list of keywords `_. For - ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free - text string, for example \"expect words related to technology\". Prompt is not supported with - ``gpt-realtime-whisper`` in GA Realtime sessions.""" - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls how long the model waits before emitting transcription text. Higher values can improve - transcription accuracy at the cost of latency. Only supported with ``gpt-realtime-whisper`` in - GA Realtime sessions. Is one of the following types: Literal[\"minimal\"], Literal[\"low\"], - Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" - model: Union[str, "_models.VoiceAgentInputTranscriptionModel"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The transcription model identifier. Configure customer custom speech deployments in - ``custom_speech``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", - \"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\", \"gpt-4o-transcribe-diarize\", - \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", and \"azure-speech\".""" - custom_speech: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional customer custom speech deployment configuration, keyed by locale.""" - phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional phrase hints that bias recognition toward domain terms.""" + type: Literal[VoiceAgentLiveConversationItemType.OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. OUTPUT.""" + transcription: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured assistant transcription, not backend output or commentary guidance.""" + audio: Optional["_models.VoiceAudioItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured audio metadata; audio.item_id matches this item's id.""" @overload def __init__( self, *, - model: Union[str, "_models.VoiceAgentInputTranscriptionModel"], - language: Optional[str] = None, - languages: Optional[list[str]] = None, - keywords: Optional[list[str]] = None, - prompt: Optional[str] = None, - delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = None, - custom_speech: Optional[dict[str, str]] = None, - phrase_list: Optional[list[str]] = None, + id: str, # pylint: disable=redefined-builtin + transcription: Optional[str] = None, + audio: Optional["_models.VoiceAudioItem"] = None, ) -> None: ... @overload @@ -29341,41 +33483,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = VoiceAgentLiveConversationItemType.OUTPUT # type: ignore -class VoiceAgentInterimResponseConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Fields shared by interim-response configurations. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - VoiceAgentLlmInterimResponseConfig, VoiceAgentStaticInterimResponseConfig +class VoiceAgentLiveResponsesDelegationConversationItem( + VoiceAgentLiveDelegationConversationItem, discriminator="responses" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Stored Responses delegation output, separate from Live speech. - :ivar type: The interim-response implementation. Required. Default value is None. - :vartype type: str - :ivar triggers: Conditions that may trigger one interim response. - :vartype triggers: list[str or ~azure.ai.projects.models.VoiceAgentInterimResponseTrigger] - :ivar latency_threshold_ms: The latency threshold in milliseconds. - :vartype latency_threshold_ms: ~datetime.timedelta + :ivar id: Item ID used for retrieval. Foundry assigns speech IDs; delegation IDs retain their + native value. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. DELEGATION. + :vartype type: str or ~azure.ai.projects.models.DELEGATION + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar created_at: Observed delegation creation time, in Unix seconds. Required. + :vartype created_at: ~datetime.datetime + :ivar target: Required. RESPONSES. + :vartype target: str or ~azure.ai.projects.models.RESPONSES + :ivar output: Final backend text, omitted when unavailable; excludes raw tool output. + :vartype output: str """ __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The interim-response implementation. Required. Default value is None.""" - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Conditions that may trigger one interim response.""" - latency_threshold_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The latency threshold in milliseconds.""" + target: Literal[VoiceAgentLiveDelegationTarget.RESPONSES] = rest_discriminator(name="target", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. RESPONSES.""" + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Final backend text, omitted when unavailable; excludes raw tool output.""" @overload def __init__( self, *, - type: str, - triggers: Optional[list[Union[str, "_models.VoiceAgentInterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[datetime.timedelta] = None, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + response_id: Optional[str] = None, + output: Optional[str] = None, ) -> None: ... @overload @@ -29387,6 +33532,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.target = VoiceAgentLiveDelegationTarget.RESPONSES # type: ignore class VoiceAgentLlmGeneratedGreetingConfig( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py index ceec269ca869..e5f1e0b15405 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py @@ -17,6 +17,7 @@ ) from azure.core.utils import case_insensitive_dict from .._utils.polling import AIProjectsLROBasePolling, AsyncAIProjectsLROBasePolling +from . import _models from ._patch_evaluation_typeddicts import ( AzureAIAgentTargetParam, AzureAIBenchmarkPreviewEvalRunDataSource, @@ -805,6 +806,31 @@ def from_continuation_token( ] # Add all objects you want publicly available to users at this package level +def _deserialize_voice( + cls: type[_models.VoiceAgentBaseDefinition], data: Any, _exist_discriminators: list[str] +) -> _models.VoiceAgentBaseDefinition: + """Preserve typed voice readback without inserting an omitted sub_protocol. + + The pinned TypeSpec exposes this optional selector as OpenAPI-only metadata. + Remove this hook when regenerated models preserve the same types and omission. + + :param data: The wire representation of the voice agent definition. + :type data: Any + :param _exist_discriminators: Higher-level discriminators supplied by the model deserializer. + :type _exist_discriminators: list[str] + :return: The concrete voice definition, or the voice base model for a future selector. + :rtype: ~azure.ai.projects.models.VoiceAgentBaseDefinition + """ + if not isinstance(data, Mapping): + return cls(data) + protocol = data.get("sub_protocol", "realtime") + if protocol == "realtime": + return _models.VoiceAgentDefinition(data) + if protocol == "live": + return _models.VoiceAgentLiveDefinition(data) + return _models.VoiceAgentBaseDefinition(data) + + def patch_sdk(): """Do not remove from this file. @@ -812,3 +838,4 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + setattr(_models.VoiceAgentBaseDefinition, "_deserialize", classmethod(_deserialize_voice)) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 31880837c921..d5a334362a82 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -4685,6 +4685,274 @@ def build_beta_voice_agents_conversations_download_audio_request( # pylint: dis return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_beta_voice_agents_live_conversations_list_request( # pylint: disable=name-too-long + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_delete_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_beta_voice_agents_live_conversations_list_items_request( # pylint: disable=name-too-long + agent_name: str, + conversation_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, + before: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if order is not None: + _params["order"] = _SERIALIZER.query("order", order, "str") + if after is not None: + _params["after"] = _SERIALIZER.query("after", after, "str") + if before is not None: + _params["before"] = _SERIALIZER.query("before", before, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_item_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items/{item_id}" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "item_id": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_audio_item_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items/{item_id}/audio" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "item_id": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_download_audio_item_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, item_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "audio/wav") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/items/{item_id}/audio/content" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + "item_id": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_get_audio_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/audio" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_beta_voice_agents_live_conversations_download_audio_request( # pylint: disable=name-too-long + agent_name: str, conversation_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "audio/wav") + + # Construct URL + _url = "/agents/{agent_name}/endpoint/protocols/voice/live/conversations/{conversation_id}/audio/content" + path_format_arguments = { + "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), + "conversation_id": _SERIALIZER.url("conversation_id", conversation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_beta_voice_agents_telephony_create_binding_request( # pylint: disable=name-too-long agent_name: str, **kwargs: Any ) -> HttpRequest: @@ -13895,6 +14163,9 @@ def __init__(self, *args, **kwargs) -> None: self.conversations = BetaVoiceAgentsConversationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.live_conversations = BetaVoiceAgentsLiveConversationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.telephony = BetaVoiceAgentsTelephonyOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -23324,6 +23595,730 @@ def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) - return deserialized # type: ignore +class BetaVoiceAgentsLiveConversationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`live_conversations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, + agent_name: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceAgentLiveConversation"]: + """List Live voice agent conversations. + + Lists stored Live conversations for this agent, including sessions stored via an override. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversation + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_request( + agent_name=agent_name, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversation], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) + + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceAgentLiveConversation: + """Get a Live voice agent conversation. + + Gets a stored Live conversation; fetch items separately. Returns 404 if absent or not stored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceAgentLiveConversation. The VoiceAgentLiveConversation is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversation] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, agent_name: str, conversation_id: str, **kwargs: Any + ) -> None: + """Delete a Live voice agent conversation. + + Deletes the stored conversation and its items/audio, without closing the Live session. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_delete_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_items( + self, + agent_name: str, + conversation_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.VoiceAgentLiveConversationItem"]: + """List items in a Live voice agent conversation. + + Lists stored speech and delegation items in order; cursors use item IDs. Returns 404 if the + conversation is absent or unstored. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of VoiceAgentLiveConversationItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.VoiceAgentLiveConversationItem] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VoiceAgentLiveConversationItem]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_voice_agents_live_conversations_list_items_request( + agent_name=agent_name, + conversation_id=conversation_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VoiceAgentLiveConversationItem], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) + + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAgentLiveConversationItem: + """Get a Live voice agent conversation item. + + Gets a stored item by ID. Returns 404 if the item or conversation is absent. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAgentLiveConversationItem. The VoiceAgentLiveConversationItem is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAgentLiveConversationItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAgentLiveConversationItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAgentLiveConversationItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> _models.VoiceAudioItem: + """Get a Live conversation item's audio metadata. + + Gets captured speech-audio metadata. BYOS uses unsigned blob_uri. Returns 404 for missing + audio, unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: VoiceAudioItem. The VoiceAudioItem is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceAudioItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceAudioItem] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceAudioItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def download_audio_item( + self, agent_name: str, conversation_id: str, item_id: str, **kwargs: Any + ) -> Iterator[bytes]: + """Stream a Live conversation item's audio. + + Streams captured speech as WAV. BYOS returns 409; use blob_uri. Returns 404 for missing audio, + unstored conversations, or delegation items. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :param item_id: The id returned on the persisted item. Required. + :type item_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_item_request( + agent_name=agent_name, + conversation_id=conversation_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> _models.VoiceRecording: + """Get a Live conversation's merged recording metadata. + + Gets merged stereo recording metadata (user left, assistant right). BYOS uses unsigned + blob_uri. Returns 404 for no audio, or 409 recording_not_ready/recording_unavailable for + pending/failed finalization; pending responses may include Retry-After. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: VoiceRecording. The VoiceRecording is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.VoiceRecording + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VoiceRecording] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_get_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VoiceRecording, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) -> Iterator[bytes]: + """Stream a Live conversation's merged recording. + + Streams the merged stereo WAV. BYOS returns 409; use blob_uri. Returns 404 for no audio, or 409 + recording_not_ready/recording_unavailable for pending/failed finalization. + + :param agent_name: The name of the Live voice agent. Required. + :type agent_name: str + :param conversation_id: The Foundry conversation ID returned in + session.started.conversation_id. Required. + :type conversation_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_voice_agents_live_conversations_download_audio_request( + agent_name=agent_name, + conversation_id=conversation_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param """ .. warning:: diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 1af36d277b6f..3e60266b2083 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -6,11 +6,11 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 192 unique public methods: +There are a total of 201 unique public methods: - 5 stable methods on the client - 84 stable methods on top-level sub-clients -- 103 beta methods on nested beta sub-clients +- 112 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) @@ -42,6 +42,7 @@ There are a total of 192 unique public methods: | `beta.schedules` | BetaSchedulesOperations | 6 | | `beta.skills` | BetaSkillsOperations | 11 | | `beta.voice_agents.conversations` | BetaVoiceAgentsConversationsOperations | 14 | +| `beta.voice_agents.live_conversations` | BetaVoiceAgentsLiveConversationsOperations | 9 | | `beta.voice_agents.realtime` | BetaRealtime | 1 | | `beta.voice_agents.telephony` | BetaVoiceAgentsTelephonyOperations | 14 | @@ -261,6 +262,16 @@ Alphabetically sorted. An asterisk at the end of the method name means it is a h .beta.voice_agents.conversations.list_response_items .beta.voice_agents.conversations.list_responses +.beta.voice_agents.live_conversations.delete +.beta.voice_agents.live_conversations.download_audio +.beta.voice_agents.live_conversations.download_audio_item +.beta.voice_agents.live_conversations.get +.beta.voice_agents.live_conversations.get_audio +.beta.voice_agents.live_conversations.get_audio_item +.beta.voice_agents.live_conversations.get_item +.beta.voice_agents.live_conversations.list +.beta.voice_agents.live_conversations.list_items + .beta.voice_agents.realtime.connect* .beta.voice_agents.telephony.cancel_call_job diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py index 2fe8c3214150..40f3dca663db 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py @@ -22,6 +22,7 @@ from azure.core.credentials import AccessToken from websockets.typing import Subprotocol +from azure.ai.projects import models from azure.ai.projects._realtime import ( BetaRealtime, BetaRealtimeConnectionManager, @@ -38,6 +39,46 @@ _ENDPOINT = "https://my-account.services.ai.azure.com/api/projects/my-project" +@pytest.mark.parametrize( + "sub_protocol,expected_type", + [ + (None, models.VoiceAgentDefinition), + ("realtime", models.VoiceAgentDefinition), + ("live", models.VoiceAgentLiveDefinition), + ("future-protocol", models.VoiceAgentBaseDefinition), + ], +) +def test_voice_agent_readback_preserves_concrete_types_and_wire_omission(sub_protocol, expected_type): + definition = { + "kind": "voice", + "model": "deployment-test", + "model_type": "self_deployed" if sub_protocol == "live" else "managed", + } + if sub_protocol is not None: + definition["sub_protocol"] = sub_protocol + version = models.AgentVersionDetails({"name": "agent-test", "version": "1", "definition": definition}) + + assert type(version.definition) is expected_type + assert version.definition.as_dict() == definition + assert expected_type(definition).as_dict() == definition + if isinstance(version.definition, (models.VoiceAgentDefinition, models.VoiceAgentLiveDefinition)): + assert version.definition.model == "deployment-test" + + +@pytest.mark.parametrize( + "definition,expected_type", + [ + ({"kind": "prompt", "model": "deployment-test"}, models.PromptAgentDefinition), + ({"kind": "future-agent-kind", "custom": {"setting": True}}, models.AgentDefinition), + ], +) +def test_voice_readback_customization_does_not_change_other_agent_kinds(definition, expected_type): + version = models.AgentVersionDetails({"name": "agent-test", "version": "1", "definition": definition}) + + assert type(version.definition) is expected_type + assert version.definition.as_dict() == definition + + class _FakeCredential: """Sync stub credential that returns a never-expiring token.""" diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 036315be25ee..0736db91c329 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 1ff3cf500bfd4d8f9195e09fd640a1e6b71161cd +commit: c929d7f888525c9ddffe218a07cd6fc76f3d3610 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From c570d346f831a1bc3acb3eca0720eac3b4ea2495 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Tue, 20 Oct 2026 15:45:04 -0700 Subject: [PATCH 03/20] [azure-ai-projects] Allow generated Live unmute vocabulary in spelling checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .vscode/cspell.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 60c5b116004f..a3cfe95f3cb8 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -469,6 +469,8 @@ "uninstrument", "uninstrumented", "uninstrumenting", + "unmute", + "unmuted", "unpad", "unpadder", "unpartial", From a0d30136e1fce761a178f919b5d83759b93b443a Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Tue, 20 Oct 2026 20:14:47 -0700 Subject: [PATCH 04/20] Fix GPT Live generated selector Pyright overrides Apply scoped optional-selector typing corrections through PostEmitter while preserving public Literal types and runtime behavior. Add constructor and annotation regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/PostEmitter.ps1 | 33 +++++++++++++++++++ .../azure/ai/projects/models/_models.py | 6 ++-- .../tests/agents/test_realtime_client.py | 23 +++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/PostEmitter.ps1 b/sdk/ai/azure-ai-projects/PostEmitter.ps1 index ee2644b22ca3..4aeeae8a3c55 100644 --- a/sdk/ai/azure-ai-projects/PostEmitter.ps1 +++ b/sdk/ai/azure-ai-projects/PostEmitter.ps1 @@ -26,6 +26,39 @@ git restore pyproject.toml # recursive-include samples *.py *.md git restore MANIFEST.in +# The optional OpenAPI-only voice selector cannot use a required TypeSpec discriminator. +# Mirror the emitter's per-member override exceptions without widening the public Literal types. +# Upstream follow-up: report optional-selector handling in http-client-python; remove after regeneration passes unpatched. +$f = 'azure\ai\projects\models\_models.py' +$c = Get-Content $f -Raw +$newline = if ($c.Contains("`r`n")) { "`r`n" } else { "`n" } +$voiceSelectorFixes = @( + @{ + Class = 'VoiceAgentDefinition' + Pattern = '(?m)^( sub_protocol: Optional\[Literal\["realtime"\]\] = rest_field\()([^\r\n]+)\)(\r?)$' + Patched = '(?m)^ sub_protocol: Optional\[Literal\["realtime"\]\] = rest_field\( # pyright: ignore\[reportIncompatibleVariableOverride\]\r?$' + Replacement = '$1 # pyright: ignore[reportIncompatibleVariableOverride]' + $newline + ' $2' + $newline + ' )$3' + }, + @{ + Class = 'VoiceAgentLiveDefinition' + Pattern = '(?m)^( self\.sub_protocol: Literal\["live"\] = "live")(\r?)$' + Patched = '(?m)^ self\.sub_protocol: Literal\["live"\] = "live" # pyright: ignore\[reportIncompatibleVariableOverride\]\r?$' + Replacement = '$1 # pyright: ignore[reportIncompatibleVariableOverride]$2' + } +) +foreach ($fix in $voiceSelectorFixes) { + $classes = [regex]::Matches($c, '(?ms)^class ' + $fix.Class + '\b.*?(?=^class |\z)') + if ($classes.Count -ne 1) { throw "Expected one generated $($fix.Class) class." } + $class = $classes[0] + if ([regex]::IsMatch($class.Value, $fix.Patched)) { continue } + if ([regex]::Matches($class.Value, $fix.Pattern).Count -ne 1) { + throw "Generated $($fix.Class).sub_protocol changed; review the optional-selector typing fix." + } + $updated = [regex]::Replace($class.Value, $fix.Pattern, $fix.Replacement) + $c = $c.Remove($class.Index, $class.Length).Insert($class.Index, $updated) +} +Set-Content $f $c -NoNewline + # Force streaming in get_session_log_stream for both sync and async operations. $files = 'azure\ai\projects\operations\_operations.py', 'azure\ai\projects\aio\operations\_operations.py' foreach ($f in $files) { diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 53e19b5444b5..fc8d967e58bc 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -32317,7 +32317,9 @@ class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstri :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig """ - sub_protocol: Optional[Literal["realtime"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + sub_protocol: Optional[Literal["realtime"]] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] + visibility=["read", "create", "update", "delete", "query"] + ) """Selects Realtime. May be omitted for legacy agents. Default value is \"realtime\".""" model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -33195,7 +33197,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sub_protocol: Literal["live"] = "live" + self.sub_protocol: Literal["live"] = "live" # pyright: ignore[reportIncompatibleVariableOverride] self.model_type: Literal["self_deployed"] = "self_deployed" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py index 40f3dca663db..5027e9e291c1 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py @@ -15,6 +15,7 @@ import json import inspect import logging +from typing import Literal, Optional from unittest.mock import MagicMock, patch from urllib.parse import parse_qs, urlparse @@ -79,6 +80,28 @@ def test_voice_readback_customization_does_not_change_other_agent_kinds(definiti assert version.definition.as_dict() == definition +@pytest.mark.parametrize( + "definition_type,expected_annotation,expected_payload", + [ + ( + models.VoiceAgentDefinition, + Optional[Literal["realtime"]], + {"model": "deployment-test", "kind": "voice"}, + ), + ( + models.VoiceAgentLiveDefinition, + Literal["live"], + {"model": "deployment-test", "kind": "voice", "sub_protocol": "live", "model_type": "self_deployed"}, + ), + ], +) +def test_voice_protocol_typing_fix_preserves_annotations_and_constructor_defaults( + definition_type, expected_annotation, expected_payload +): + assert definition_type.__annotations__["sub_protocol"] == expected_annotation + assert definition_type(model="deployment-test").as_dict() == expected_payload + + class _FakeCredential: """Sync stub credential that returns a never-expiring token.""" From c54e6ce68e07e6d8cde46df961c8a177dc7e97d8 Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Thu, 22 Oct 2026 08:29:39 -0700 Subject: [PATCH 05/20] Add CloudComputerUsePreviewTool and related models; update package version to 2.10.0 (#49650) --- sdk/ai/azure-ai-projects/api.md | 33 ++++++ sdk/ai/azure-ai-projects/api.metadata.yml | 6 +- .../azure-ai-projects/apiview-properties.json | 4 +- .../azure/ai/projects/models/__init__.py | 4 + .../azure/ai/projects/models/_enums.py | 4 + .../azure/ai/projects/models/_models.py | 112 +++++++++++++++--- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 7 files changed, 145 insertions(+), 20 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 65eafd3d828d..14c058cc8afb 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -5825,6 +5825,35 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.CloudComputerUsePreviewTool(Tool, discriminator='cloud_computer_use_preview'): + type: Literal[ToolType.CLOUD_COMPUTER_USE_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CloudComputerUsePreviewToolboxTool(ToolboxTool, discriminator='cloud_computer_use_preview'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.CLOUD_COMPUTER_USE_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.ClusterInsightResult(_Model): clusters: list[InsightCluster] coordinates: Optional[dict[str, ChartCoordinate]] @@ -8340,6 +8369,7 @@ namespace azure.ai.projects.models code_configuration: Optional[CodeConfiguration] container_configuration: Optional[ContainerConfiguration] cpu: str + enable_memory_snapshot: Optional[bool] environment_variables: Optional[dict[str, str]] kind: Literal[AgentKind.HOSTED] memory: str @@ -8355,6 +8385,7 @@ namespace azure.ai.projects.models code_configuration: Optional[CodeConfiguration] = ..., container_configuration: Optional[ContainerConfiguration] = ..., cpu: str, + enable_memory_snapshot: Optional[bool] = ..., environment_variables: Optional[dict[str, str]] = ..., memory: str, protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., @@ -14510,6 +14541,7 @@ namespace azure.ai.projects.models BROWSER_AUTOMATION = "browser_automation" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" CODE_INTERPRETER = "code_interpreter" COMPUTER = "computer" COMPUTER_USE_PREVIEW = "computer_use_preview" @@ -14742,6 +14774,7 @@ namespace azure.ai.projects.models AZURE_AI_SEARCH = "azure_ai_search" BROWSER_AUTOMATION = "browser_automation" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" CODE_INTERPRETER = "code_interpreter" FABRIC_IQ_PREVIEW = "fabric_iq_preview" FILE_SEARCH = "file_search" diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 6d6343ea5c66..b62a6af6a953 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: bb1ea6eb387aed40913818d64b40f39438c2e7800793c097bd7fea2fb0f4c3f3 -packageVersion: 2.9.0 +apiHash: c14dce33f27bced47cbb3c32e5e0ae9d6571207afde1a04fd2f300eb61e6da4f +packageVersion: 2.10.0 parserVersion: 0.3.31 -pythonVersion: 3.12.10 +pythonVersion: 3.12.4 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 4a21720c683a..b53968854104 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -141,6 +141,8 @@ "azure.ai.projects.models.ChatCompletionTool": "OpenAI.ChatCompletionTool", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", "azure.ai.projects.models.ChatSummaryMemoryItem": "Azure.AI.Projects.ChatSummaryMemoryItem", + "azure.ai.projects.models.CloudComputerUsePreviewTool": "Azure.AI.Projects.CloudComputerUsePreviewTool", + "azure.ai.projects.models.CloudComputerUsePreviewToolboxTool": "Azure.AI.Projects.CloudComputerUsePreviewToolboxTool", "azure.ai.projects.models.ClusterInsightResult": "Azure.AI.Projects.ClusterInsightResult", "azure.ai.projects.models.ClusterTokenUsage": "Azure.AI.Projects.ClusterTokenUsage", "azure.ai.projects.models.EvaluatorDefinition": "Azure.AI.Projects.EvaluatorDefinition", @@ -999,5 +1001,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "05e1b80a337b" + "CrossLanguageVersion": "3e7266b01602" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index 2442af4e0e21..fb94f312d5a4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -144,6 +144,8 @@ ChartCoordinate, ChatCompletionTool, ChatSummaryMemoryItem, + CloudComputerUsePreviewTool, + CloudComputerUsePreviewToolboxTool, ClusterInsightResult, ClusterTokenUsage, CodeBasedEvaluatorDefinition, @@ -994,6 +996,8 @@ "ChartCoordinate", "ChatCompletionTool", "ChatSummaryMemoryItem", + "CloudComputerUsePreviewTool", + "CloudComputerUsePreviewToolboxTool", "ClusterInsightResult", "ClusterTokenUsage", "CodeBasedEvaluatorDefinition", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 2c54cd780175..1f23cc97f937 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -2203,6 +2203,8 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """WEB_IQ_PREVIEW.""" BROWSER_AUTOMATION = "browser_automation" """BROWSER_AUTOMATION.""" + CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" + """CLOUD_COMPUTER_USE_PREVIEW.""" class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2333,6 +2335,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OPENAPI.""" MICROSOFT_COPILOT_TOOLSET_PREVIEW = "microsoft_copilot_toolset_preview" """MICROSOFT_COPILOT_TOOLSET_PREVIEW.""" + CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" + """CLOUD_COMPUTER_USE_PREVIEW.""" class TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 5d5140de90d8..3af14c753494 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -176,11 +176,12 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2ATool, A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationTool, - BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, - ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, - FileSearchTool, FunctionTool, GitHubCopilotToolsetPreview, ImageGenTool, LocalShellToolParam, - MCPTool, MemorySearchPreviewTool, MicrosoftCopilotToolsetPreview, NamespaceToolParam, - OpenApiTool, ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, + BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CloudComputerUsePreviewTool, + CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, CustomToolParam, + MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, + GitHubCopilotToolsetPreview, ImageGenTool, LocalShellToolParam, MCPTool, + MemorySearchPreviewTool, MicrosoftCopilotToolsetPreview, NamespaceToolParam, OpenApiTool, + ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, WebIQPreviewTool, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", @@ -190,8 +191,8 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", "memory_search_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", "web_iq_preview", "github_copilot_toolset_preview", "a2a", "azure_ai_search", "azure_function", - "bing_grounding", "browser_automation", "capture_structured_outputs", "openapi", and - "microsoft_copilot_toolset_preview". + "bing_grounding", "browser_automation", "capture_structured_outputs", "openapi", + "microsoft_copilot_toolset_preview", and "cloud_computer_use_preview". :vartype type: str or ~azure.ai.projects.models.ToolType """ @@ -205,8 +206,8 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", \"fabric_iq_preview\", \"toolbox_search_preview\", \"web_iq_preview\", \"github_copilot_toolset_preview\", \"a2a\", \"azure_ai_search\", \"azure_function\", - \"bing_grounding\", \"browser_automation\", \"capture_structured_outputs\", \"openapi\", and - \"microsoft_copilot_toolset_preview\".""" + \"bing_grounding\", \"browser_automation\", \"capture_structured_outputs\", \"openapi\", + \"microsoft_copilot_toolset_preview\", and \"cloud_computer_use_preview\".""" @overload def __init__( @@ -289,15 +290,17 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2AToolboxTool, A2APreviewToolboxTool, AzureAISearchToolboxTool, BrowserAutomationToolboxTool, - BrowserAutomationPreviewToolboxTool, CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, - FileSearchToolboxTool, MCPToolboxTool, OpenApiToolboxTool, ReminderPreviewToolboxTool, - ShellToolboxTool, ToolSearchToolboxTool, ToolboxSearchPreviewToolboxTool, - WebIQPreviewToolboxTool, WebSearchToolboxTool, WorkIQPreviewToolboxTool + BrowserAutomationPreviewToolboxTool, CloudComputerUsePreviewToolboxTool, + CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, FileSearchToolboxTool, MCPToolboxTool, + OpenApiToolboxTool, ReminderPreviewToolboxTool, ShellToolboxTool, ToolSearchToolboxTool, + ToolboxSearchPreviewToolboxTool, WebIQPreviewToolboxTool, WebSearchToolboxTool, + WorkIQPreviewToolboxTool :ivar type: The type of tool. Required. Known values are: "code_interpreter", "file_search", "web_search", "mcp", "azure_ai_search", "openapi", "a2a_preview", "browser_automation_preview", "reminder_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search", - "toolbox_search_preview", "a2a", "shell", "web_iq_preview", and "browser_automation". + "toolbox_search_preview", "a2a", "shell", "web_iq_preview", "browser_automation", and + "cloud_computer_use_preview". :vartype type: str or ~azure.ai.projects.models.ToolboxToolType :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -315,7 +318,7 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key \"web_search\", \"mcp\", \"azure_ai_search\", \"openapi\", \"a2a_preview\", \"browser_automation_preview\", \"reminder_preview\", \"work_iq_preview\", \"fabric_iq_preview\", \"toolbox_search\", \"toolbox_search_preview\", \"a2a\", \"shell\", - \"web_iq_preview\", and \"browser_automation\".""" + \"web_iq_preview\", \"browser_automation\", and \"cloud_computer_use_preview\".""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional user-defined name for this tool or configuration.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -6494,6 +6497,76 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore +class CloudComputerUsePreviewTool(Tool, discriminator="cloud_computer_use_preview"): + """The input definition information for a cloud computer use tool, as used to configure an agent. + + :ivar type: The object type, which is always ``cloud_computer_use_preview``. Required. + CLOUD_COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.CLOUD_COMPUTER_USE_PREVIEW + """ + + type: Literal[ToolType.CLOUD_COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always ``cloud_computer_use_preview``. Required. + CLOUD_COMPUTER_USE_PREVIEW.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.CLOUD_COMPUTER_USE_PREVIEW # type: ignore + + +class CloudComputerUsePreviewToolboxTool( + ToolboxTool, discriminator="cloud_computer_use_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A cloud computer use tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. CLOUD_COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.CLOUD_COMPUTER_USE_PREVIEW + """ + + type: Literal[ToolboxToolType.CLOUD_COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CLOUD_COMPUTER_USE_PREVIEW.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolboxToolType.CLOUD_COMPUTER_USE_PREVIEW # type: ignore + + class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the cluster analysis. @@ -12387,6 +12460,10 @@ class HostedAgentDefinition( :ivar session_configuration: Optional session defaults (for example, the idle timeout) applied to sessions created for this agent version. :vartype session_configuration: ~azure.ai.projects.models.SessionConfiguration + :ivar enable_memory_snapshot: Whether this agent version uses memory snapshots. Sessions for a + snapshot-enabled version start from a snapshot of the agent's initialized process rather than + starting the process from its image. Defaults to false. + :vartype enable_memory_snapshot: bool """ kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -12423,6 +12500,10 @@ class HostedAgentDefinition( ) """Optional session defaults (for example, the idle timeout) applied to sessions created for this agent version.""" + enable_memory_snapshot: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this agent version uses memory snapshots. Sessions for a snapshot-enabled version start + from a snapshot of the agent's initialized process rather than starting the process from its + image. Defaults to false.""" @overload def __init__( @@ -12437,6 +12518,7 @@ def __init__( code_configuration: Optional["_models.CodeConfiguration"] = None, telemetry_config: Optional["_models.TelemetryConfig"] = None, session_configuration: Optional["_models.SessionConfiguration"] = None, + enable_memory_snapshot: Optional[bool] = None, ) -> None: ... @overload diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 036315be25ee..67b8121475c6 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 1ff3cf500bfd4d8f9195e09fd640a1e6b71161cd +commit: b2cf9e36ed967aae8c43ed56973e1d1ac99255b3 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From ba6c352b044d5705c3d654a1d35c5b8522aebeb2 Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Thu, 22 Oct 2026 10:22:07 -0700 Subject: [PATCH 06/20] =?UTF-8?q?Add=20comprehensive=20tests=20for=20envir?= =?UTF-8?q?onment=20variable=20handling=20and=20recordi=E2=80=A6=20(#49613?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add comprehensive tests for environment variable handling and recording state - Introduced `GetEnvironmentFileVariables.Tests.ps1` to validate environment variable parsing from .env files. - Added `GetSampleRequiredEnvironmentVariables.Tests.ps1` to ensure required environment variables are correctly identified for samples. - Created `InvokeSampleTest.Integration.Tests.ps1` and `InvokeSampleTest.Tests.ps1` for testing sample execution in various modes, including playback and recording. - Implemented `ResetRecordingState.Tests.ps1` to verify cleanup of recording state and pytest cache. - Developed `ResolveSampleTest.Tests.ps1` to test sample resolution and error handling for ambiguous or missing files. - Added `TestRecordingGitConflicts.Tests.ps1` to check for recording conflicts in git repositories. - Created `TestHelpers.ps1` to provide reusable functions for test setup and synthetic package creation. - Updated `conftest.py` to support command-line options for environment variable configuration. * Update cspell configuration and improve test assertions for multiline values --- .vscode/cspell.json | 1 + .../.github/skills/README.md | 4 + .../azure-ai-projects-record-sample/SKILL.md | 87 +++++ .../scripts/GetEnvironmentFileVariables.ps1 | 85 +++++ .../GetSampleRequiredEnvironmentVariables.ps1 | 68 ++++ .../scripts/InvokeSampleTest.ps1 | 356 ++++++++++++++++++ .../scripts/ResetRecordingState.ps1 | 25 ++ .../scripts/ResolveSampleTest.ps1 | 154 ++++++++ .../scripts/TestRecordingGitConflicts.ps1 | 152 ++++++++ .../GetEnvironmentFileVariables.Tests.ps1 | 75 ++++ ...mpleRequiredEnvironmentVariables.Tests.ps1 | 49 +++ .../InvokeSampleTest.Integration.Tests.ps1 | 61 +++ .../tests/InvokeSampleTest.Tests.ps1 | 99 +++++ .../tests/ResetRecordingState.Tests.ps1 | 45 +++ .../tests/ResolveSampleTest.Tests.ps1 | 75 ++++ .../tests/TestHelpers.ps1 | 214 +++++++++++ .../tests/TestRecordingGitConflicts.Tests.ps1 | 149 ++++++++ sdk/ai/azure-ai-projects/tests/conftest.py | 46 ++- 18 files changed, 1744 insertions(+), 1 deletion(-) create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 60c5b116004f..6835d2156166 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -401,6 +401,7 @@ "prevsnapshot", "prompty", "pschema", + "pscustomobject", "PSECRET", "pstn", "pydantic", diff --git a/sdk/ai/azure-ai-projects/.github/skills/README.md b/sdk/ai/azure-ai-projects/.github/skills/README.md index ce50c2376e5d..558c0af9dac7 100644 --- a/sdk/ai/azure-ai-projects/.github/skills/README.md +++ b/sdk/ai/azure-ai-projects/.github/skills/README.md @@ -57,6 +57,10 @@ This skill compares a newly emitted or merged public API surface with its select This skill updates existing pytest coverage and authors complete sync/async Test Proxy tests for new behavior. New recorded service tests remain enabled so missing-recording errors surface in PR validation and authors can contact the SDK maintainer for help. +### azure-ai-projects-record-sample + +This skill prompts for record-and-playback, record-only, playback-only, or live test locally, then runs one parameterized sample test. It scans required environment variables and passes effective `.env` values as pytest arguments. + ### azure-ai-projects-model-reference-graph This skill generates structured and readable graphs that trace every generated model through direct references, inheritance, runtime ownership, and public operation methods. It supports model-usage investigation and TypeSpec removal analysis without treating static reachability as proof that a model is safe to remove. diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md new file mode 100644 index 000000000000..f6f9a9020d8a --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/SKILL.md @@ -0,0 +1,87 @@ +--- +name: azure-ai-projects-record-sample +description: 'Record, play back, or run an azure-ai-projects Python sample live with the Test Proxy. WHEN: record sample, rerecord sample, record and playback, record only, playback only, live test locally, validate recording. Always prompts for an execution mode. Scans required environment variables and passes effective .env values as pytest command-line arguments. DO NOT USE FOR: authoring tests or samples; non-sample service tests; other packages.' +argument-hint: 'Sample path or node ID; choose mode when prompted' +--- + +# Record and verify an azure-ai-projects sample + +Run from `sdk\ai\azure-ai-projects`. This workflow may modify Test Proxy recordings. Never commit `.env`, credentials, access tokens, API keys, or unsanitized resource identifiers. + +## Execution modes + +Before previewing, always use the question tool to ask the user to choose exactly one mode. Do this even when the request appears to imply a mode; never infer or default it. + +| Mode | `AZURE_TEST_RUN_LIVE` | `AZURE_SKIP_LIVE_RECORDING` | Behavior | +| --- | --- | --- | --- | +| `record-and-playback` | `true`, then `false` | `false`, then `true` | Record, then verify playback even if recording fails. | +| `record-only` | `true` | `false` | Record without running playback. | +| `playback-only` | `false` | `true` | Run only from an existing recording. | +| `live-test-locally` | `true` | `true` | Contact the live service locally without creating or updating a recording. | + +Do not silently substitute one mode for another. Include the selected mode in the final report. + +## 1. Preview the plan + +Run the orchestrator without `-Run`: + +```powershell +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" ` + -Mode "" +``` + +It deterministically resolves the collected pytest node, scans required sample variables, detects selected `AdditionalSampleTestDetail` values and LLM validation, reads effective `.env` assignments, maps supported pytest options, selects mode flags, and prints a plan. The plan includes the resolved sample path, pytest node, and effective environment variables as `key=value` entries. Pytest command previews remain redacted. Treat the preview as sensitive and do not paste it into reports or source files. + +If multiple nodes execute the sample, the script lists them and stops. Ask the user which scenario to use, then rerun preview with `-NodeId ""`. If a required name is missing or empty, report the name and remind the user to check `.env`; do not invent a value. + +Lower-level scripts under `scripts\` are for diagnosing the orchestrator only. Do not repeat their work manually during a normal run. + +## 2. Obtain approval + +For `record-and-playback`, `record-only`, and `live-test-locally`, use the question tool to ask for input confirmation immediately before execution: + +**Confirm inputs:** "Use sample ``, pytest node ``, and the displayed `key=value` environment variables?" + +Include the preview's environment entries plus missing and empty variable names in the question's supporting message. If the user does not confirm, update the requested sample, node, or `.env` as directed and rerun preview before asking again. + +Also ask the action-specific approval in the same question-tool call: + +- For `record-and-playback` and `record-only`: **Approve recording:** "Start recording now? It may update Test Proxy recordings." +- For `live-test-locally`: **Approve live test:** "Start the live test locally without recording now?" + +Do not run unless both input confirmation and action approval are `Yes`. `playback-only` needs neither confirmation. + +## 3. Execute + +Use the same sample, selected node, and mode from preview: + +```powershell +# record-and-playback or record-only +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" -NodeId "" -Mode "" ` + -Run -ConfirmSelection -ConfirmRecording + +# playback-only +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" -NodeId "" -Mode "playback-only" -Run + +# live-test-locally +.\.github\skills\azure-ai-projects-record-sample\scripts\InvokeSampleTest.ps1 ` + -SamplePath "" -NodeId "" -Mode "live-test-locally" ` + -Run -ConfirmSelection -ConfirmLive +``` + +The orchestrator keeps values internal, loads only relevant `.env` names, and handles all mode flags. Immediately before recording, it stops `*testproxy*` processes and deletes `.pytest_cache`. `record-and-playback` proceeds to playback even when recording fails. After a successful hosted-agent recording it runs `tests\samples\repair_hosted_agent_sample_recording.py` before playback or completion. + +Recording modes invoke `scripts\TestRecordingGitConflicts.ps1` during preview and again immediately before cleanup. Treat that script's result as authoritative; do not reproduce its conflict checks in the skill workflow. + +## 4. Diagnose only relevant failures + +If playback fails, inspect only the selected node's mismatch and named recording. Make the smallest sanitizer or deterministic-input fix. Before another recording attempt, rerun preview and ask both recording questions again. + +Do not repair unrelated failures, edit recordings by hand, or fall back to bare pytest/VS Code playback. Never stage, commit, or push recordings unless explicitly requested. + +## 5. Validate and report + +Run `git diff --check` and `git status --short`. Report the selected mode, sample, and node; environment variable names used; required, harness-supplied, missing, and empty names; recording, repair, playback, and live results; and changed recording paths. Do not repeat environment values in the final report. Report unselected steps as `not run`. Never claim `record-and-playback` success unless playback passed. \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 new file mode 100644 index 000000000000..8dd0f42250ac --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetEnvironmentFileVariables.ps1 @@ -0,0 +1,85 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [string]$EnvFile, + [string]$PythonExecutable, + [string]$PackageRoot, + [switch]$IncludeValues +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} + +if (-not $EnvFile) { + $EnvFile = Join-Path $packageRoot ".env" +} elseif (-not [System.IO.Path]::IsPathRooted($EnvFile)) { + $EnvFile = Join-Path $packageRoot $EnvFile +} +if (-not (Test-Path -LiteralPath $EnvFile -PathType Leaf)) { + throw "Environment file not found: $EnvFile" +} +$EnvFile = (Get-Item -LiteralPath $EnvFile).FullName + +if (-not $PythonExecutable) { + $windowsVenvPython = Join-Path $packageRoot ".venv\Scripts\python.exe" + $posixVenvPython = Join-Path $packageRoot ".venv\bin\python" + if (Test-Path -LiteralPath $windowsVenvPython) { + $PythonExecutable = $windowsVenvPython + } elseif (Test-Path -LiteralPath $posixVenvPython) { + $PythonExecutable = $posixVenvPython + } else { + $PythonExecutable = "python" + } +} + +$pythonScript = @' +from __future__ import annotations + +import json +from pathlib import Path +import sys + +from dotenv import dotenv_values +from dotenv.parser import parse_stream + + +env_path = Path(sys.argv[1]) +with env_path.open(encoding="utf-8-sig") as stream: + bindings = list(parse_stream(stream)) + +effective_values = dotenv_values(env_path, encoding="utf-8-sig") +seen: set[str] = set() +variables: list[dict[str, object]] = [] +for binding in reversed(bindings): + name = binding.key + if not name or name in seen: + continue + seen.add(name) + variables.append( + { + "Name": name, + "Value": effective_values.get(name), + "LineNumber": binding.original.line, + } + ) + +print(json.dumps(variables)) +'@ + +$output = @($pythonScript | & $PythonExecutable - $EnvFile) +if ($LASTEXITCODE -ne 0) { + throw "Unable to parse environment file '$EnvFile'." +} +$variables = @($output -join [Environment]::NewLine | ConvertFrom-Json) + +if ($IncludeValues) { + $variables +} else { + $variables | Select-Object -ExpandProperty Name +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 new file mode 100644 index 000000000000..6a7c538d7805 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/GetSampleRequiredEnvironmentVariables.ps1 @@ -0,0 +1,68 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [Parameter(Position = 0)] + [Alias("Sample")] + [string[]]$SamplePath, + + [string]$PackageRoot +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} +$samplesRoot = Join-Path $packageRoot "samples" + +function Resolve-SampleFile { + param([string]$RequestedPath) + + $candidate = $RequestedPath + if (-not [System.IO.Path]::IsPathRooted($candidate)) { + $candidate = Join-Path $packageRoot $candidate + } + if (Test-Path -LiteralPath $candidate -PathType Leaf) { + return (Get-Item -LiteralPath $candidate).FullName + } + + $name = [System.IO.Path]::GetFileName($RequestedPath) + if (-not $name.EndsWith(".py", [System.StringComparison]::OrdinalIgnoreCase)) { + $name += ".py" + } + $sampleMatches = @(Get-ChildItem -Path $samplesRoot -Recurse -File -Filter $name) + if ($sampleMatches.Count -eq 0) { + throw "Could not find sample '$RequestedPath' under '$samplesRoot'." + } + if ($sampleMatches.Count -gt 1) { + throw "Sample '$RequestedPath' matched multiple files. Pass a path relative to the package root." + } + return $sampleMatches[0].FullName +} + +$files = if ($SamplePath) { + @($SamplePath | ForEach-Object { Resolve-SampleFile $_ }) +} else { + @(Get-ChildItem -Path $samplesRoot -Recurse -File -Filter "*.py" | ForEach-Object { $_.FullName }) +} + +$patterns = @( + 'os\.environ\s*\[\s*["''](?[A-Z][A-Z0-9_]*)["'']\s*\](?!\s*=)', + '(?:os\.environ\.get|os\.getenv)\s*\(\s*["''](?[A-Z][A-Z0-9_]*)["'']\s*\)(?!\s*or\b)', + 'get_required_env_var\s*\(\s*["''](?[A-Z][A-Z0-9_]*)["'']\s*\)' +) + +$names = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) +foreach ($file in $files) { + $content = Get-Content -LiteralPath $file -Raw + foreach ($pattern in $patterns) { + foreach ($match in [regex]::Matches($content, $pattern, [System.Text.RegularExpressions.RegexOptions]::Singleline)) { + $null = $names.Add($match.Groups["name"].Value) + } + } +} + +$names | Sort-Object \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 new file mode 100644 index 000000000000..a6e632ed001c --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/InvokeSampleTest.ps1 @@ -0,0 +1,356 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true, Position = 0)] + [Alias("Sample")] + [string]$SamplePath, + + [string]$NodeId, + + [ValidateSet("record-and-playback", "record-only", "playback-only", "live-test-locally")] + [string]$Mode, + + [string]$EnvFile, + [string]$PythonExecutable, + [string]$PackageRoot, + [ValidateSet("main", "feature/azure-ai-projects/vnext")] + [string]$BaseBranch, + [string]$RecordingConflictCheckScript, + [string]$RecordingCleanupScript, + [switch]$Run, + [switch]$ConfirmSelection, + [switch]$ConfirmRecording, + [switch]$ConfirmLive +) + +$ErrorActionPreference = "Stop" +if ([string]::IsNullOrWhiteSpace($Mode)) { + throw "Mode is required. Choose record-and-playback, record-only, playback-only, or live-test-locally." +} +$scriptRoot = $PSScriptRoot +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $scriptRoot "..\..\..\..")).Path).FullName +} +if (-not $PythonExecutable) { + $windowsVenvPython = Join-Path $packageRoot ".venv\Scripts\python.exe" + $posixVenvPython = Join-Path $packageRoot ".venv\bin\python" + if (Test-Path -LiteralPath $windowsVenvPython) { + $PythonExecutable = $windowsVenvPython + } elseif (Test-Path -LiteralPath $posixVenvPython) { + $PythonExecutable = $posixVenvPython + } else { + $PythonExecutable = "python" + } +} +if (-not $EnvFile) { + $EnvFile = Join-Path $packageRoot ".env" +} + +$resolver = Join-Path $scriptRoot "ResolveSampleTest.ps1" +$requiredVariableScanner = Join-Path $scriptRoot "GetSampleRequiredEnvironmentVariables.ps1" +$environmentFileScanner = Join-Path $scriptRoot "GetEnvironmentFileVariables.ps1" +if (-not $RecordingCleanupScript) { + $RecordingCleanupScript = Join-Path $scriptRoot "ResetRecordingState.ps1" +} +if (-not $RecordingConflictCheckScript) { + $RecordingConflictCheckScript = Join-Path $scriptRoot "TestRecordingGitConflicts.ps1" +} + +$resolvedNodes = @( + & $resolver -SamplePath $SamplePath -PackageRoot $packageRoot -PythonExecutable $PythonExecutable +) +if ($NodeId) { + $normalizedRequestedNode = $NodeId.Replace("\", "/") + $resolvedNodes = @( + $resolvedNodes | Where-Object { + $candidate = $_.NodeId.Replace("\", "/") + $candidate -eq $normalizedRequestedNode -or $candidate.EndsWith($normalizedRequestedNode) + } + ) + if ($resolvedNodes.Count -eq 0) { + throw "The requested node id does not execute '$SamplePath': $NodeId" + } +} +if ($resolvedNodes.Count -gt 1) { + $choices = $resolvedNodes.NodeId -join [Environment]::NewLine + throw "Multiple pytest nodes execute this sample. Rerun with -NodeId and one of:$([Environment]::NewLine)$choices" +} +$resolved = $resolvedNodes[0] +$NodeId = $resolved.NodeId +$resolvedSamplePath = Join-Path $packageRoot $resolved.SamplePath + +$requiredNames = @( + & $requiredVariableScanner -SamplePath $resolvedSamplePath -PackageRoot $packageRoot +) + +$metadataScript = @' +from __future__ import annotations + +import ast +import json +from pathlib import Path +import re +import sys + + +root = Path(sys.argv[1]).resolve() +sample_path = Path(sys.argv[2]).resolve() +node_id = sys.argv[3].replace("\\", "/") + + +def parse(path: Path) -> ast.Module: + return ast.parse(path.read_text(encoding="utf-8-sig"), filename=str(path)) + + +def literal_keyword(call: ast.Call, name: str): + keyword = next((item for item in call.keywords if item.arg == name), None) + if keyword is None: + return None + try: + return ast.literal_eval(keyword.value) + except (TypeError, ValueError): + return None + + +tests_index = node_id.find("tests/") +if tests_index < 0: + raise RuntimeError(f"Node id has no tests/ path: {node_id}") +parts = node_id[tests_index:].split("::") +test_path = root / parts[0] +method_name = parts[-1].split("[", 1)[0] +parameter_match = re.search(r"\[(?P.*)\]$", node_id) +parameter_id = parameter_match.group("id") if parameter_match else "" +tree = parse(test_path) + +uses_llm_validation = False +for node in ast.walk(tree): + if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and node.name == method_name: + uses_llm_validation = any( + isinstance(child, ast.Attribute) + and child.attr in {"validate_print_calls_by_llm", "validate_print_calls_by_llm_async"} + for child in ast.walk(node) + ) + break + +harness_names: set[str] = set() +for call in (node for node in ast.walk(tree) if isinstance(node, ast.Call)): + function_name = call.func.id if isinstance(call.func, ast.Name) else getattr(call.func, "attr", None) + if function_name != "AdditionalSampleTestDetail": + continue + filename = literal_keyword(call, "sample_filename") + test_id = literal_keyword(call, "test_id") + env_vars = literal_keyword(call, "env_vars") or {} + if not test_id: + test_id = f"{Path(filename).stem}-[{','.join(sorted(env_vars))}]" + if filename == sample_path.name and test_id == parameter_id: + harness_names.update(env_vars) + +option_map: dict[str, str] = {} +test_base_path = root / "tests" / "test_base.py" +if test_base_path.is_file(): + for node in parse(test_base_path).body: + if not isinstance(node, ast.Assign): + continue + if not any(isinstance(target, ast.Name) and target.id == "servicePreparer" for target in node.targets): + continue + if isinstance(node.value, ast.Call): + for keyword in node.value.keywords: + if keyword.arg: + option_map[keyword.arg.upper()] = keyword.arg + +print( + json.dumps( + { + "HarnessNames": sorted(harness_names), + "UsesLlmValidation": uses_llm_validation, + "OptionMap": option_map, + } + ) +) +'@ +$metadataJson = @($metadataScript | & $PythonExecutable - $packageRoot $resolvedSamplePath $NodeId) +if ($LASTEXITCODE -ne 0) { + throw "Unable to inspect the selected sample test metadata." +} +$metadata = $metadataJson -join [Environment]::NewLine | ConvertFrom-Json + +$allRequiredNames = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) +foreach ($name in $requiredNames) { + $null = $allRequiredNames.Add([string]$name) +} +if ($metadata.UsesLlmValidation) { + $null = $allRequiredNames.Add("LLM_VALIDATION_PROJECT_ENDPOINT") +} +$harnessNames = @($metadata.HarnessNames) + +$envFileVariables = if (Test-Path -LiteralPath $EnvFile -PathType Leaf) { + @( + & $environmentFileScanner -EnvFile $EnvFile -PackageRoot $packageRoot ` + -PythonExecutable $PythonExecutable -IncludeValues + ) +} else { + @() +} +$envByName = @{} +foreach ($variable in $envFileVariables) { + $envByName[$variable.Name] = $variable.Value +} + +$optionMap = @{} +foreach ($property in $metadata.OptionMap.PSObject.Properties) { + $optionMap[$property.Name] = [string]$property.Value +} +$commandLineValues = [ordered]@{} +$processEnvironmentValues = [ordered]@{} +$missingNames = [System.Collections.Generic.List[string]]::new() +$emptyNames = [System.Collections.Generic.List[string]]::new() +$usedEnvironmentNames = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::Ordinal) + +foreach ($name in @($allRequiredNames | Sort-Object)) { + if (-not $envByName.ContainsKey($name)) { + $missingNames.Add($name) + continue + } + $value = $envByName[$name] + if ([string]::IsNullOrEmpty([string]$value)) { + $emptyNames.Add($name) + continue + } + if ($optionMap.ContainsKey($name)) { + $commandLineValues[$optionMap[$name]] = [string]$value + } else { + $processEnvironmentValues[$name] = [string]$value + } + $null = $usedEnvironmentNames.Add($name) +} +foreach ($name in $harnessNames) { + if (-not $envByName.ContainsKey($name) -or [string]::IsNullOrEmpty([string]$envByName[$name])) { + continue + } + if ($optionMap.ContainsKey($name)) { + $commandLineValues[$optionMap[$name]] = [string]$envByName[$name] + } else { + $processEnvironmentValues[$name] = [string]$envByName[$name] + } + $null = $usedEnvironmentNames.Add([string]$name) +} + +$steps = switch ($Mode) { + "record-and-playback" { @("record", "playback") } + "record-only" { @("record") } + "playback-only" { @("playback") } + "live-test-locally" { @("live") } +} +$flags = @{ + record = @("--azure_test_run_live=true", "--azure_skip_live_recording=false") + playback = @("--azure_test_run_live=false", "--azure_skip_live_recording=true") + live = @("--azure_test_run_live=true", "--azure_skip_live_recording=true") +} + +$conflictCheckArguments = $null +$recordingConflictResult = $null +if ($steps -contains "record") { + $conflictCheckArguments = @{ PackageRoot = $packageRoot } + if ($BaseBranch) { + $conflictCheckArguments.BaseBranch = $BaseBranch + } + $recordingConflictResult = & $RecordingConflictCheckScript @conflictCheckArguments +} + +Write-Output "Mode: $Mode" +Write-Output "Sample: $($resolved.SamplePath)" +Write-Output "Node: $NodeId" +Write-Output "Required: $((@($allRequiredNames | Sort-Object) -join ', '))" +Write-Output "Harness-supplied: $($harnessNames -join ', ')" +Write-Output "Missing: $($missingNames -join ', ')" +Write-Output "Empty: $($emptyNames -join ', ')" +if ($usedEnvironmentNames.Count -eq 0) { + Write-Output "Environment variables used: " +} else { + Write-Output "Environment variables used:" + foreach ($name in @($usedEnvironmentNames | Sort-Object)) { + Write-Output " $name=$($envByName[$name])" + } +} +Write-Output "Steps: $($steps -join ', ')" +if ($recordingConflictResult) { + Write-Output "Recording conflict check: safe ($($recordingConflictResult.AssetRelationship))" +} +Write-Output "CLI values loaded: $($commandLineValues.Count); process values loaded: $($processEnvironmentValues.Count)" + +if (-not $Run) { + foreach ($step in $steps) { + $redactedOptions = @($commandLineValues.Keys | ForEach-Object { "--$_=" }) + Write-Output "$step command: pytest -s $($redactedOptions -join ' ') $($flags[$step] -join ' ')" + } + return +} + +if (($steps -contains "record" -or $steps -contains "live") -and -not $ConfirmSelection) { + throw "Execution selection was not confirmed. Review the sample, node, and environment variable names, then rerun with -Run -ConfirmSelection." +} +if ($steps -contains "record" -and -not $ConfirmRecording) { + throw "Recording may modify files. Rerun with -Run -ConfirmRecording after user approval." +} +if ($steps -contains "live" -and -not $ConfirmLive) { + throw "Live execution contacts Azure. Rerun with -Run -ConfirmLive after user approval." +} + +$originalEnvironment = @{} +foreach ($entry in $processEnvironmentValues.GetEnumerator()) { + $originalEnvironment[$entry.Key] = [Environment]::GetEnvironmentVariable($entry.Key, "Process") + [Environment]::SetEnvironmentVariable($entry.Key, $entry.Value, "Process") +} + +$results = [ordered]@{} +try { + foreach ($step in $steps) { + if ($step -eq "record") { + $recordingConflictResult = & $RecordingConflictCheckScript @conflictCheckArguments + Write-Output "recording conflict recheck: safe ($($recordingConflictResult.AssetRelationship))" + & $RecordingCleanupScript -PackageRoot $packageRoot + Write-Output "recording cleanup: completed" + } + $pytestArguments = @("-m", "pytest", $NodeId, "-s") + foreach ($entry in $commandLineValues.GetEnumerator()) { + $pytestArguments += "--$($entry.Key)=$($entry.Value)" + } + $pytestArguments += $flags[$step] + Push-Location $packageRoot + try { + & $PythonExecutable @pytestArguments + $results[$step] = $LASTEXITCODE + } finally { + Pop-Location + } + + if ($step -eq "record" -and $resolved.SamplePath.Replace("/", "\").StartsWith("samples\hosted_agents\")) { + $repairScript = Join-Path $packageRoot "tests\samples\repair_hosted_agent_sample_recording.py" + if ($results[$step] -eq 0 -and (Test-Path -LiteralPath $repairScript)) { + & $PythonExecutable $repairScript $NodeId + $results["repair"] = $LASTEXITCODE + } else { + $results["repair"] = "not run" + } + } + } +} finally { + foreach ($entry in $originalEnvironment.GetEnumerator()) { + [Environment]::SetEnvironmentVariable($entry.Key, $entry.Value, "Process") + } +} + +foreach ($entry in $results.GetEnumerator()) { + Write-Output "$($entry.Key) result: $($entry.Value)" +} +$failedResults = @( + $results.GetEnumerator() | Where-Object { $_.Value -is [int] -and $_.Value -ne 0 } +) +if ($failedResults.Count -gt 0) { + $failureSummary = @($failedResults | ForEach-Object { "$($_.Key)=$($_.Value)" }) -join ", " + throw "Sample test workflow failed: $failureSummary" +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 new file mode 100644 index 000000000000..efa81a831820 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResetRecordingState.ps1 @@ -0,0 +1,25 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [string]$PackageRoot, + [scriptblock]$ProcessProvider = { Get-Process }, + [scriptblock]$ProcessStopper = { param($Processes) $Processes | Stop-Process -Force } +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} + +$testProxyProcesses = @( + & $ProcessProvider | Where-Object { $_.ProcessName -like "*testproxy*" } +) +if ($testProxyProcesses.Count -gt 0) { + & $ProcessStopper $testProxyProcesses +} + +Remove-Item -Recurse -Force (Join-Path $packageRoot ".pytest_cache") -ErrorAction SilentlyContinue \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 new file mode 100644 index 000000000000..8d06b9945f01 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/ResolveSampleTest.ps1 @@ -0,0 +1,154 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true, Position = 0)] + [Alias("Sample")] + [string]$SamplePath, + + [string]$PythonExecutable, + [string]$PackageRoot +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} +$samplesRoot = Join-Path $packageRoot "samples" + +if (-not $PythonExecutable) { + $windowsVenvPython = Join-Path $packageRoot ".venv\Scripts\python.exe" + $posixVenvPython = Join-Path $packageRoot ".venv\bin\python" + if (Test-Path -LiteralPath $windowsVenvPython) { + $PythonExecutable = $windowsVenvPython + } elseif (Test-Path -LiteralPath $posixVenvPython) { + $PythonExecutable = $posixVenvPython + } else { + $PythonExecutable = "python" + } +} + +function Resolve-SampleFile { + param([string]$RequestedPath) + + $candidate = $RequestedPath + if (-not [System.IO.Path]::IsPathRooted($candidate)) { + $candidate = Join-Path $packageRoot $candidate + } + if (Test-Path -LiteralPath $candidate -PathType Leaf) { + return (Get-Item -LiteralPath $candidate).FullName + } + + $name = [System.IO.Path]::GetFileName($RequestedPath) + if (-not $name.EndsWith(".py", [System.StringComparison]::OrdinalIgnoreCase)) { + $name += ".py" + } + $sampleMatches = @(Get-ChildItem -Path $samplesRoot -Recurse -File -Filter $name) + if ($sampleMatches.Count -eq 0) { + throw "Could not find sample '$RequestedPath' under '$samplesRoot'." + } + if ($sampleMatches.Count -gt 1) { + throw "Sample '$RequestedPath' matched multiple files. Pass a path relative to the package root." + } + return $sampleMatches[0].FullName +} + +$resolvedSample = Resolve-SampleFile $SamplePath +$testFiles = @( + Get-ChildItem -Path (Join-Path $packageRoot "tests\samples") -File -Filter "test_samples*.py" | + Where-Object { -not $_.Name.EndsWith("_helpers.py") } | + ForEach-Object { $_.FullName } +) + +$temporaryDirectory = Join-Path ([System.IO.Path]::GetTempPath()) ("resolve-sample-test-{0}" -f [guid]::NewGuid()) +$pluginPath = Join-Path $temporaryDirectory "sample_node_collector.py" +$outputPath = Join-Path $temporaryDirectory "sample-nodes.json" +$pluginSource = @' +import json +import os +from pathlib import Path + + +def pytest_collection_finish(session): + records = [] + for item in session.items: + callspec = getattr(item, "callspec", None) + if callspec is None: + continue + sample_path = callspec.params.get("sample_path") + if sample_path is None: + continue + records.append( + { + "samplePath": str(Path(str(sample_path)).resolve()), + "nodeId": item.nodeid, + } + ) + Path(os.environ["AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT"]).write_text( + json.dumps(records), encoding="utf-8" + ) +'@ + +New-Item -ItemType Directory -Path $temporaryDirectory | Out-Null +[System.IO.File]::WriteAllText($pluginPath, $pluginSource, [System.Text.UTF8Encoding]::new($false)) + +$oldPythonPath = $env:PYTHONPATH +$oldOutputPath = $env:AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT +try { + $env:PYTHONPATH = if ($oldPythonPath) { "$temporaryDirectory$([System.IO.Path]::PathSeparator)$oldPythonPath" } else { $temporaryDirectory } + $env:AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT = $outputPath + Push-Location $packageRoot + try { + $collectionOutput = @( + & $PythonExecutable -m pytest --collect-only -q -p sample_node_collector @testFiles ` + --azure_test_run_live=false --azure_skip_live_recording=true 2>&1 + ) + if ($LASTEXITCODE -ne 0) { + throw "pytest collection failed:`n$($collectionOutput -join [Environment]::NewLine)" + } + } finally { + Pop-Location + } + + $records = @(Get-Content -LiteralPath $outputPath -Raw | ConvertFrom-Json) +} finally { + $env:PYTHONPATH = $oldPythonPath + $env:AZURE_AI_PROJECTS_SAMPLE_NODE_OUTPUT = $oldOutputPath + Remove-Item -LiteralPath $temporaryDirectory -Recurse -Force -ErrorAction SilentlyContinue +} + +$pathComparison = if ($env:OS -eq "Windows_NT") { + [System.StringComparison]::OrdinalIgnoreCase +} else { + [System.StringComparison]::Ordinal +} +$matchingNodes = @( + $records | + Where-Object { [string]::Equals($_.samplePath, $resolvedSample, $pathComparison) } | + Select-Object -ExpandProperty nodeId -Unique | + ForEach-Object { + $normalizedNodeId = $_.Replace("\", "/") + $testsIndex = $normalizedNodeId.IndexOf("tests/") + if ($testsIndex -ge 0) { + $normalizedNodeId.Substring($testsIndex) + } else { + $normalizedNodeId + } + } | + Sort-Object +) + +if ($matchingNodes.Count -eq 0) { + throw "No collected sample test executes '$resolvedSample'. The sample may be excluded from the recorded sample harness." +} + +$relativeSample = [System.IO.Path]::GetRelativePath($packageRoot, $resolvedSample).Replace("/", "\") +foreach ($nodeId in $matchingNodes) { + [pscustomobject]@{ + SamplePath = $relativeSample + NodeId = $nodeId + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 new file mode 100644 index 000000000000..df7ba29fde01 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/scripts/TestRecordingGitConflicts.ps1 @@ -0,0 +1,152 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param( + [string]$PackageRoot, + [ValidateSet("main", "feature/azure-ai-projects/vnext")] + [string]$BaseBranch, + [string]$AssetsRepositoryPath, + [switch]$SkipFetch +) + +$ErrorActionPreference = "Stop" +if ($PackageRoot) { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path -LiteralPath $PackageRoot).Path).FullName +} else { + $packageRoot = (Get-Item -LiteralPath (Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..")).Path).FullName +} + +function Invoke-Git { + param( + [string]$WorkingDirectory, + [string[]]$Arguments, + [switch]$AllowFailure + ) + + $output = @(& git -C $WorkingDirectory @Arguments 2>&1) + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0 -and -not $AllowFailure) { + throw "git $($Arguments -join ' ') failed:`n$($output -join [Environment]::NewLine)" + } + [pscustomobject]@{ + ExitCode = $exitCode + Output = ($output -join [Environment]::NewLine).Trim() + } +} + +$repositoryRoot = (Invoke-Git $packageRoot @("rev-parse", "--show-toplevel")).Output +$repositoryRoot = (Get-Item -LiteralPath $repositoryRoot).FullName +$currentBranch = (Invoke-Git $repositoryRoot @("branch", "--show-current")).Output +if (-not $currentBranch) { + throw "Recording is blocked from a detached HEAD. Switch to a branch and rebase the target first." +} + +if (-not $BaseBranch) { + if ($currentBranch -in @("main", "feature/azure-ai-projects/vnext")) { + $BaseBranch = $currentBranch + } else { + throw "BaseBranch is required for topic branch '$currentBranch'. Choose main or feature/azure-ai-projects/vnext." + } +} + +$remoteExists = (Invoke-Git $repositoryRoot @("remote", "get-url", "origin") -AllowFailure).ExitCode -eq 0 +if ($remoteExists -and -not $SkipFetch) { + $refspec = "+refs/heads/$BaseBranch`:refs/remotes/origin/$BaseBranch" + $fetch = Invoke-Git $repositoryRoot @("fetch", "--quiet", "origin", $refspec) -AllowFailure + if ($fetch.ExitCode -ne 0) { + throw "Unable to refresh origin/$BaseBranch. Recording is blocked because base freshness cannot be verified." + } +} + +$remoteBaseRef = "refs/remotes/origin/$BaseBranch" +$localBaseRef = "refs/heads/$BaseBranch" +if ((Invoke-Git $repositoryRoot @("show-ref", "--verify", "--quiet", $remoteBaseRef) -AllowFailure).ExitCode -eq 0) { + $baseRef = "origin/$BaseBranch" +} elseif ((Invoke-Git $repositoryRoot @("show-ref", "--verify", "--quiet", $localBaseRef) -AllowFailure).ExitCode -eq 0) { + $baseRef = $BaseBranch +} else { + throw "Base branch '$BaseBranch' was not found locally or under origin." +} + +$sourceAncestor = Invoke-Git $repositoryRoot @("merge-base", "--is-ancestor", $baseRef, "HEAD") -AllowFailure +if ($sourceAncestor.ExitCode -ne 0) { + throw "Recording is blocked: HEAD does not contain the latest '$baseRef'. Rebase the target branch, then retry." +} + +$relativePackagePath = [System.IO.Path]::GetRelativePath($repositoryRoot, $packageRoot).Replace("\", "/") +$assetsRelativePath = "$relativePackagePath/assets.json" +$localAssetsPath = Join-Path $packageRoot "assets.json" +if (-not (Test-Path -LiteralPath $localAssetsPath -PathType Leaf)) { + throw "Recording is blocked: local assets.json was not found at '$localAssetsPath'." +} + +try { + $localAssets = Get-Content -LiteralPath $localAssetsPath -Raw | ConvertFrom-Json + $baseAssetsText = (Invoke-Git $repositoryRoot @("show", "$baseRef`:$assetsRelativePath")).Output + $baseAssets = $baseAssetsText | ConvertFrom-Json +} catch { + throw "Recording is blocked: unable to parse local or base assets.json. $($_.Exception.Message)" +} + +$localTag = [string]$localAssets.Tag +$baseTag = [string]$baseAssets.Tag +if (-not $localTag -or -not $baseTag) { + throw "Recording is blocked: local or base assets.json does not contain a Tag." +} + +$assetRelationship = "same" +$baseAssetCommit = $null +$localAssetCommit = $null +$baseAssetCommitDate = $null +$localAssetCommitDate = $null +if ($localTag -ne $baseTag) { + if (-not $AssetsRepositoryPath) { + $breadcrumbRoot = Join-Path $repositoryRoot ".assets\breadcrumb" + if (Test-Path -LiteralPath $breadcrumbRoot -PathType Container) { + $breadcrumb = Get-ChildItem -LiteralPath $breadcrumbRoot -File -Filter "*.breadcrumb" | + Where-Object { (Get-Content -LiteralPath $_.FullName -Raw).StartsWith("$assetsRelativePath;") } | + Select-Object -First 1 + if ($breadcrumb) { + $parts = (Get-Content -LiteralPath $breadcrumb.FullName -Raw).Trim().Split(";") + if ($parts.Count -ge 2) { + $AssetsRepositoryPath = Join-Path (Join-Path $repositoryRoot ".assets") $parts[1] + } + } + } + } + if (-not $AssetsRepositoryPath -or -not (Test-Path -LiteralPath (Join-Path $AssetsRepositoryPath ".git"))) { + throw "Recording is blocked: local assets tag differs from '$baseRef', but the assets Git cache is unavailable for ancestry validation." + } + + $baseAssetCommitResult = Invoke-Git $AssetsRepositoryPath @("rev-parse", "$baseTag`^{commit}") -AllowFailure + $localAssetCommitResult = Invoke-Git $AssetsRepositoryPath @("rev-parse", "$localTag`^{commit}") -AllowFailure + if ($baseAssetCommitResult.ExitCode -ne 0 -or $localAssetCommitResult.ExitCode -ne 0) { + throw "Recording is blocked: base or local asset tag is unavailable in the assets Git cache." + } + $baseAssetCommit = $baseAssetCommitResult.Output + $localAssetCommit = $localAssetCommitResult.Output + $assetAncestor = Invoke-Git $AssetsRepositoryPath @( + "merge-base", "--is-ancestor", $baseAssetCommit, $localAssetCommit + ) -AllowFailure + if ($assetAncestor.ExitCode -ne 0) { + throw "Recording is blocked: local asset tag '$localTag' is not descended from base tag '$baseTag'. Rebase the target branch before recording." + } + $assetRelationship = "descendant" + $baseAssetCommitDate = (Invoke-Git $AssetsRepositoryPath @("show", "-s", "--format=%cI", $baseAssetCommit)).Output + $localAssetCommitDate = (Invoke-Git $AssetsRepositoryPath @("show", "-s", "--format=%cI", $localAssetCommit)).Output +} + +[pscustomobject]@{ + CurrentBranch = $currentBranch + BaseBranch = $BaseBranch + BaseRef = $baseRef + LocalTag = $localTag + BaseTag = $baseTag + AssetRelationship = $assetRelationship + BaseAssetCommit = $baseAssetCommit + LocalAssetCommit = $localAssetCommit + BaseAssetCommitDate = $baseAssetCommitDate + LocalAssetCommitDate = $localAssetCommitDate + SafeToRecord = $true +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 new file mode 100644 index 000000000000..e576179e5ad3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetEnvironmentFileVariables.Tests.ps1 @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "GetEnvironmentFileVariables.ps1" { + BeforeAll { + $script:envFile = Join-Path $TestDrive ".env" + @' +# ignored comment +FIRST=old-value +EMPTY= +export EXPORTED="quoted value" +MULTILINE="first line +second line" +FIRST=effective-value +BARE +'@ | Set-Content -LiteralPath $envFile -Encoding UTF8 + } + + It "returns names in bottom-to-top effective assignment order" { + $actual = @(& $paths.EnvironmentFileScanner -EnvFile $envFile -PythonExecutable $paths.PythonExecutable) + ($actual -join ",") | Should Be "BARE,FIRST,MULTILINE,EXPORTED,EMPTY" + } + + It "returns last duplicate values and source lines" { + $actual = @( + & $paths.EnvironmentFileScanner -EnvFile $envFile ` + -PythonExecutable $paths.PythonExecutable -IncludeValues + ) + $first = @($actual | Where-Object { $_.Name -eq "FIRST" }) + $multiline = @($actual | Where-Object { $_.Name -eq "MULTILINE" }) + $first.Count | Should Be 1 + $first[0].Value | Should Be "effective-value" + $first[0].LineNumber | Should Be 7 + $multiline[0].Value | Should Be ("first line", "second line" -join "`n") + } + + It "uses the package-root .env by default" { + $packageRoot = Join-Path $TestDrive "default-env-package" + New-Item -ItemType Directory -Path $packageRoot | Out-Null + "DEFAULT_NAME=default-value" | Set-Content -LiteralPath (Join-Path $packageRoot ".env") -Encoding UTF8 + $actual = @( + & $paths.EnvironmentFileScanner -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable + ) + ($actual -join ",") | Should Be "DEFAULT_NAME" + } + + It "returns no names for an empty environment file" { + $emptyEnv = Join-Path $TestDrive "empty.env" + "# no assignments" | Set-Content -LiteralPath $emptyEnv -Encoding UTF8 + $actual = @(& $paths.EnvironmentFileScanner -EnvFile $emptyEnv -PythonExecutable $paths.PythonExecutable) + $actual.Count | Should Be 0 + } + + It "rejects a missing environment file" { + $caught = $null + try { + & $paths.EnvironmentFileScanner -EnvFile (Join-Path $TestDrive "missing.env") ` + -PythonExecutable $paths.PythonExecutable + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "reports a Python execution failure" { + $caught = $null + try { + & $paths.EnvironmentFileScanner -EnvFile $envFile ` + -PythonExecutable (Join-Path $TestDrive "missing-python.exe") + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 new file mode 100644 index 000000000000..6a5098b5572f --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/GetSampleRequiredEnvironmentVariables.Tests.ps1 @@ -0,0 +1,49 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "GetSampleRequiredEnvironmentVariables.ps1" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "scanner-package" + New-SyntheticPackage $packageRoot + } + + It "returns the required variables for a selected sample" { + $actual = @(& $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "sample_unique.py") + ($actual -join ",") | Should Be "DIRECT_REQUIRED,HELPER_REQUIRED" + } + + It "excludes writes, defaults, and fallbacks" { + $actual = @(& $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "sample_unique.py") + ($actual -join ",") | Should Not Match "ASSIGNED_ONLY|OPTIONAL_WITH_DEFAULT|OPTIONAL_WITH_FALLBACK" + } + + It "returns sorted unique names for the full sample tree" { + $actual = @(& $paths.EnvironmentScanner -PackageRoot $packageRoot) + $sortedUnique = @($actual | Sort-Object -Unique) + $actual.Count | Should Be 6 + ($actual -join "`n") | Should Be ($sortedUnique -join "`n") + } + + It "merges multiple selected samples" { + $actual = @( + & $paths.EnvironmentScanner -PackageRoot $packageRoot ` + -SamplePath "sample_unique", "sample_async.py" + ) + ($actual -join ",") | Should Be "ASYNC_REQUIRED,DIRECT_REQUIRED,HELPER_REQUIRED" + } + + It "rejects an ambiguous filename" { + $caught = $null + try { & $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "util.py" } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "rejects a missing sample" { + $caught = $null + try { & $paths.EnvironmentScanner -PackageRoot $packageRoot -SamplePath "missing.py" } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 new file mode 100644 index 000000000000..317a3d89ebf0 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Integration.Tests.ps1 @@ -0,0 +1,61 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "InvokeSampleTest.ps1 integration" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "runner-integration-package" + New-SyntheticPackage $packageRoot + $script:conflictCheckScript = Join-Path $packageRoot "synthetic-recording-conflict-check.ps1" + $script:cleanupScript = Join-Path $packageRoot "synthetic-recording-cleanup.ps1" + } + + It "executes playback without live approval" { + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "playback-only" -Run) + ($actual -join "`n") | Should Match "playback result: 0" + } + + It "executes record-only and live modes with approval" { + $cachePath = Join-Path $packageRoot ".pytest_cache" + New-Item -ItemType Directory -Path $cachePath -Force | Out-Null + $record = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_unique.py" -Mode "record-only" -Run -ConfirmSelection -ConfirmRecording) + Remove-Item -LiteralPath (Join-Path $packageRoot "recording-conflict-check-called.txt") -Force + $live = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally" -Run -ConfirmSelection -ConfirmLive) + ($record -join "`n") | Should Match "record result: 0" + ($live -join "`n") | Should Match "live result: 0" + (Test-Path -LiteralPath (Join-Path $packageRoot "recording-conflict-check-called.txt")) | Should Be $false + } + + It "executes record then playback in order" { + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_unique.py" -Mode "record-and-playback" -Run -ConfirmSelection -ConfirmRecording) + $text = $actual -join "`n" + $text.IndexOf("record result: 0") | Should BeLessThan $text.IndexOf("playback result: 0") + } + + It "continues to playback when recording fails" { + $marker = Join-Path $packageRoot "playback-after-record-failure.txt" + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_record_failure.py" -Mode "record-and-playback" -Run -ConfirmSelection -ConfirmRecording } catch { $caught = $_ } + $caught.Exception.Message | Should Match "record=1" + (Test-Path -LiteralPath $marker) | Should Be $true + } + + It "propagates playback failures and restores process environment" { + $original = $env:FAILURE_PROCESS_VALUE + $env:FAILURE_PROCESS_VALUE = "before-run" + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_playback_failure.py" -Mode "playback-only" -Run } catch { $caught = $_ } finally { $restored = $env:FAILURE_PROCESS_VALUE; $env:FAILURE_PROCESS_VALUE = $original } + $caught.Exception.Message | Should Match "playback=1" + $restored | Should Be "before-run" + } + + It "repairs hosted-agent recordings before playback" { + $marker = Join-Path $packageRoot "tests\samples\repair-called.txt" + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -RecordingCleanupScript $cleanupScript -SamplePath "sample_hosted.py" -Mode "record-and-playback" -Run -ConfirmSelection -ConfirmRecording) + (Test-Path -LiteralPath $marker) | Should Be $true + ($actual -join "`n") | Should Match "repair result: 0" + ($actual -join "`n") | Should Match "playback result: 0" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 new file mode 100644 index 000000000000..315169a3865f --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/InvokeSampleTest.Tests.ps1 @@ -0,0 +1,99 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "InvokeSampleTest.ps1 plan and guards" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "runner-unit-package" + New-SyntheticPackage $packageRoot + $script:conflictCheckScript = Join-Path $packageRoot "synthetic-recording-conflict-check.ps1" + $script:recordAndPlaybackPlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-and-playback") + $script:recordOnlyPlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-only") + $script:playbackOnlyPlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "playback-only") + $script:livePlan = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally") + } + + It "plans record followed by playback when explicitly selected" { + ($recordAndPlaybackPlan -join "`n") | Should Match "Mode: record-and-playback" + ($recordAndPlaybackPlan -join "`n") | Should Match "Steps: record, playback" + } + + It "rejects an omitted mode" { + $caught = $null + try { + & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable ` + -SamplePath "sample_unique.py" + } catch { $caught = $_ } + $caught.Exception.Message | Should Match "Mode is required" + } + + It "rejects the retired live-without-recording mode name" { + $caught = $null + try { + & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable ` + -SamplePath "sample_unique.py" -Mode "live-without-recording" + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "maps explicit modes to exact flags" { + ($recordOnlyPlan -join "`n") | Should Match "--azure_test_run_live=true --azure_skip_live_recording=false" + ($playbackOnlyPlan -join "`n") | Should Match "--azure_test_run_live=false --azure_skip_live_recording=true" + ($livePlan -join "`n") | Should Match "--azure_test_run_live=true --azure_skip_live_recording=true" + } + + It "displays effective values while redacting command arguments" { + $text = $recordAndPlaybackPlan -join "`n" + $text | Should Match "Harness-supplied: HARNESS_VALUE" + $text | Should Match "Required: DIRECT_REQUIRED, HELPER_REQUIRED, LLM_VALIDATION_PROJECT_ENDPOINT" + $text | Should Match "DIRECT_REQUIRED=real-direct-value" + $text | Should Match "HARNESS_VALUE=real-harness-value" + $text | Should Match "HELPER_REQUIRED=real-helper-value" + $text | Should Match "LLM_VALIDATION_PROJECT_ENDPOINT=https://validation.example.test/api/projects/example" + $text | Should Match "CLI values loaded: 2; process values loaded: 2" + $commandPreview = @($recordAndPlaybackPlan | Where-Object { $_ -like "* command: *" }) -join "`n" + $commandPreview | Should Not Match "real-direct-value|real-helper-value|real-harness-value" + $commandPreview | Should Match "--direct_required=" + } + + It "requires selection and action confirmations for recording and live execution" { + $recordSelectionError = $null + $liveSelectionError = $null + $recordError = $null + $liveError = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-only" -Run } catch { $recordSelectionError = $_ } + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally" -Run } catch { $liveSelectionError = $_ } + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -RecordingConflictCheckScript $conflictCheckScript -SamplePath "sample_unique.py" -Mode "record-only" -Run -ConfirmSelection } catch { $recordError = $_ } + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" -Mode "live-test-locally" -Run -ConfirmSelection } catch { $liveError = $_ } + $recordSelectionError.Exception.Message | Should Match "selection was not confirmed" + $liveSelectionError.Exception.Message | Should Match "selection was not confirmed" + $recordError.Exception.Message | Should Match "Recording may modify files" + $liveError.Exception.Message | Should Match "Live execution contacts Azure" + } + + It "selects a valid explicit node and rejects missing selection" { + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" -NodeId "tests/samples/test_samples.py::test_multiple[variant-one]" -Mode "playback-only") + ($actual -join "`n") | Should Match "variant-one" + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" -Mode "playback-only" } catch { $caught = $_ } + $caught.Exception.Message | Should Match "Multiple pytest nodes" + } + + It "rejects an invalid explicit node" { + $caught = $null + try { & $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" -NodeId "tests/samples/test_samples.py::missing[node]" -Mode "playback-only" } catch { $caught = $_ } + $caught.Exception.Message | Should Match "requested node id does not execute" + } + + It "reports missing and empty required values" { + $incompleteEnv = Join-Path $TestDrive "incomplete.env" + "DIRECT_REQUIRED=" | Set-Content -LiteralPath $incompleteEnv -Encoding UTF8 + $actual = @(& $paths.SampleTestRunner -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -EnvFile $incompleteEnv -SamplePath "sample_unique.py" -Mode "playback-only") + $text = $actual -join "`n" + $text | Should Match "Missing: HELPER_REQUIRED, LLM_VALIDATION_PROJECT_ENDPOINT" + $text | Should Match "Empty: DIRECT_REQUIRED" + $text | Should Match "Environment variables used: " + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 new file mode 100644 index 000000000000..0614af7d5b74 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResetRecordingState.Tests.ps1 @@ -0,0 +1,45 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "ResetRecordingState.ps1" { + It "stops only test proxy processes and deletes pytest cache" { + $packageRoot = Join-Path $TestDrive "cleanup-package" + $cachePath = Join-Path $packageRoot ".pytest_cache" + New-Item -ItemType Directory -Path $cachePath -Force | Out-Null + "cache" | Set-Content -LiteralPath (Join-Path $cachePath "marker.txt") -Encoding UTF8 + + $stoppedNames = [System.Collections.Generic.List[string]]::new() + $provider = { + @( + [pscustomobject]@{ ProcessName = "testproxy" }, + [pscustomobject]@{ ProcessName = "prefix-testproxy-child" }, + [pscustomobject]@{ ProcessName = "python" } + ) + }.GetNewClosure() + $stopper = { + param($Processes) + foreach ($process in $Processes) { + $stoppedNames.Add($process.ProcessName) + } + }.GetNewClosure() + + & $paths.RecordingStateReset -PackageRoot $packageRoot ` + -ProcessProvider $provider -ProcessStopper $stopper + + ($stoppedNames -join ",") | Should Be "testproxy,prefix-testproxy-child" + (Test-Path -LiteralPath $cachePath) | Should Be $false + } + + It "succeeds when there are no matching processes or cache" { + $packageRoot = Join-Path $TestDrive "empty-cleanup-package" + New-Item -ItemType Directory -Path $packageRoot -Force | Out-Null + $provider = { @([pscustomobject]@{ ProcessName = "python" }) }.GetNewClosure() + $stopper = { param($Processes) throw "Process stopper should not be called." } + + & $paths.RecordingStateReset -PackageRoot $packageRoot ` + -ProcessProvider $provider -ProcessStopper $stopper + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 new file mode 100644 index 000000000000..c2cd3c6e0751 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/ResolveSampleTest.Tests.ps1 @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +Describe "ResolveSampleTest.ps1" { + BeforeAll { + $script:packageRoot = Join-Path $TestDrive "resolver-package" + New-SyntheticPackage $packageRoot + $script:uniqueResult = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" + ) + $script:multipleResults = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_multiple.py" + ) + $script:asyncResult = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_async.py" + ) + $script:evaluationResult = @( + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_evaluation.py" + ) + } + + It "resolves a filename to one synchronous pytest node" { + $uniqueResult.Count | Should Be 1 + $uniqueResult[0].SamplePath | Should Be "samples\unique\sample_unique.py" + $uniqueResult[0].NodeId | Should Match "test_samples.py::test_unique\[unique-case\]$" + } + + It "returns every collected node for a sample" { + $multipleResults.Count | Should Be 2 + ($multipleResults.NodeId -join "`n") | Should Match "variant-one\]" + ($multipleResults.NodeId -join "`n") | Should Match "variant-two\]" + } + + It "resolves async and evaluation harnesses" { + $asyncResult[0].NodeId | Should Match "test_samples_async.py::test_async\[async-case\]$" + $evaluationResult[0].NodeId | Should Match "test_samples_evaluations.py::test_evaluation\[evaluation-case\]$" + } + + It "rejects ambiguous and missing filenames" { + $ambiguous = $null + $missing = $null + try { & $paths.SampleResolver -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "util.py" } catch { $ambiguous = $_ } + try { & $paths.SampleResolver -PackageRoot $packageRoot -PythonExecutable $paths.PythonExecutable -SamplePath "missing.py" } catch { $missing = $_ } + $ambiguous | Should Not BeNullOrEmpty + $missing | Should Not BeNullOrEmpty + } + + It "rejects a sample absent from the pytest harness" { + $caught = $null + try { + & $paths.SampleResolver -PackageRoot $packageRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_uncollected.py" + } catch { $caught = $_ } + $caught | Should Not BeNullOrEmpty + } + + It "reports pytest collection failures" { + $brokenRoot = Join-Path $TestDrive "broken-resolver-package" + New-SyntheticPackage $brokenRoot + "this is not valid python !!!" | Set-Content -LiteralPath (Join-Path $brokenRoot "tests\samples\test_samples.py") -Encoding UTF8 + $caught = $null + try { + & $paths.SampleResolver -PackageRoot $brokenRoot ` + -PythonExecutable $paths.PythonExecutable -SamplePath "sample_unique.py" + } catch { $caught = $_ } + $caught.Exception.Message | Should Match "pytest collection failed" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 new file mode 100644 index 000000000000..3d1998419f3f --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestHelpers.ps1 @@ -0,0 +1,214 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +function Get-RecordSampleTestPaths { + param([string]$TestScriptRoot) + + $skillRoot = (Resolve-Path (Join-Path $TestScriptRoot "..")).Path + $repositoryPackageRoot = (Resolve-Path (Join-Path $TestScriptRoot "..\..\..\..")).Path + [pscustomobject]@{ + EnvironmentScanner = Join-Path $skillRoot "scripts\GetSampleRequiredEnvironmentVariables.ps1" + EnvironmentFileScanner = Join-Path $skillRoot "scripts\GetEnvironmentFileVariables.ps1" + SampleResolver = Join-Path $skillRoot "scripts\ResolveSampleTest.ps1" + SampleTestRunner = Join-Path $skillRoot "scripts\InvokeSampleTest.ps1" + RecordingConflictCheck = Join-Path $skillRoot "scripts\TestRecordingGitConflicts.ps1" + RecordingStateReset = Join-Path $skillRoot "scripts\ResetRecordingState.ps1" + PythonExecutable = Join-Path $repositoryPackageRoot ".venv\Scripts\python.exe" + } +} + +function New-SyntheticPackage { + param([string]$Root) + + $directories = @( + "samples\unique", + "samples\multiple", + "samples\async", + "samples\evaluations", + "samples\failures", + "samples\first", + "samples\hosted_agents", + "samples\second", + "samples\uncollected", + "tests\samples" + ) + foreach ($directory in $directories) { + New-Item -ItemType Directory -Path (Join-Path $Root $directory) -Force | Out-Null + } + + @' +import os + +direct = os.environ["DIRECT_REQUIRED"] +helper = get_required_env_var("HELPER_REQUIRED") +os.environ["ASSIGNED_ONLY"] = "value" +optional = os.environ.get("OPTIONAL_WITH_DEFAULT", "default") +fallback = os.getenv("OPTIONAL_WITH_FALLBACK") or "default" +'@ | Set-Content -LiteralPath (Join-Path $Root "samples\unique\sample_unique.py") -Encoding UTF8 + + 'import os; value = os.environ["MULTIPLE_REQUIRED"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\multiple\sample_multiple.py") -Encoding UTF8 + 'import os; value = os.environ["ASYNC_REQUIRED"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\async\sample_async.py") -Encoding UTF8 + 'import os; value = os.environ["EVALUATION_REQUIRED"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\evaluations\sample_evaluation.py") -Encoding UTF8 + '# synthetic record failure sample' | + Set-Content -LiteralPath (Join-Path $Root "samples\failures\sample_record_failure.py") -Encoding UTF8 + 'import os; value = os.environ["FAILURE_PROCESS_VALUE"]' | + Set-Content -LiteralPath (Join-Path $Root "samples\failures\sample_playback_failure.py") -Encoding UTF8 + '# synthetic hosted-agent sample' | + Set-Content -LiteralPath (Join-Path $Root "samples\hosted_agents\sample_hosted.py") -Encoding UTF8 + '# intentionally absent from pytest collection' | + Set-Content -LiteralPath (Join-Path $Root "samples\uncollected\sample_uncollected.py") -Encoding UTF8 + '# duplicate filename fixture' | + Set-Content -LiteralPath (Join-Path $Root "samples\first\util.py") -Encoding UTF8 + '# duplicate filename fixture' | + Set-Content -LiteralPath (Join-Path $Root "samples\second\util.py") -Encoding UTF8 + + @' +def pytest_addoption(parser): + parser.addoption("--azure_test_run_live") + parser.addoption("--azure_skip_live_recording") + parser.addoption("--direct_required") + parser.addoption("--llm_validation_project_endpoint") +'@ | Set-Content -LiteralPath (Join-Path $Root "conftest.py") -Encoding UTF8 + + @' +[CmdletBinding()] +param([string]$PackageRoot) + +if (-not (Test-Path -LiteralPath (Join-Path $PackageRoot "recording-conflict-check-called.txt"))) { + throw "Recording conflict check did not run before cleanup." +} +New-Item -ItemType File -Path (Join-Path $PackageRoot "recording-cleanup-called.txt") -Force | Out-Null +Remove-Item -Recurse -Force (Join-Path $PackageRoot ".pytest_cache") -ErrorAction SilentlyContinue +'@ | Set-Content -LiteralPath (Join-Path $Root "synthetic-recording-cleanup.ps1") -Encoding UTF8 + + @' +[CmdletBinding()] +param([string]$PackageRoot, [string]$BaseBranch) + +New-Item -ItemType File -Path (Join-Path $PackageRoot "recording-conflict-check-called.txt") -Force | Out-Null +[pscustomobject]@{ AssetRelationship = "synthetic"; SafeToRecord = $true } +'@ | Set-Content -LiteralPath (Join-Path $Root "synthetic-recording-conflict-check.ps1") -Encoding UTF8 + + @' +def loader(**kwargs): + return kwargs + + +servicePreparer = loader( + direct_required="sanitized-direct", + llm_validation_project_endpoint="sanitized-validation-endpoint", +) +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\test_base.py") -Encoding UTF8 + + @' +DIRECT_REQUIRED=real-direct-value +HELPER_REQUIRED=real-helper-value +LLM_VALIDATION_PROJECT_ENDPOINT=https://validation.example.test/api/projects/example +HARNESS_VALUE=real-harness-value +FAILURE_PROCESS_VALUE=real-failure-process-value +'@ | Set-Content -LiteralPath (Join-Path $Root ".env") -Encoding UTF8 + + @' +from pathlib import Path +import pytest + +ROOT = Path(__file__).resolve().parents[2] +UNIQUE = str(ROOT / "samples" / "unique" / "sample_unique.py") +MULTIPLE = str(ROOT / "samples" / "multiple" / "sample_multiple.py") +RECORD_FAILURE = str(ROOT / "samples" / "failures" / "sample_record_failure.py") +PLAYBACK_FAILURE = str(ROOT / "samples" / "failures" / "sample_playback_failure.py") +HOSTED = str(ROOT / "samples" / "hosted_agents" / "sample_hosted.py") + + +@pytest.mark.parametrize("sample_path", [pytest.param(UNIQUE, id="unique-case")]) +def test_unique(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + skip_recording = pytestconfig.getoption("azure_skip_live_recording") == "true" + if live and not skip_recording: + assert (ROOT / "recording-conflict-check-called.txt").is_file() + assert (ROOT / "recording-cleanup-called.txt").is_file() + assert not (ROOT / ".pytest_cache").exists() + if False: + executor.validate_print_calls_by_llm() + + +if False: + AdditionalSampleTestDetail( + test_id="unique-case", + sample_filename="sample_unique.py", + env_vars={"HARNESS_VALUE": "sanitized-harness-value"}, + ) + + +@pytest.mark.parametrize( + "sample_path", + [ + pytest.param(MULTIPLE, id="variant-one"), + pytest.param(MULTIPLE, id="variant-two"), + ], +) +def test_multiple(sample_path): + pass + + +@pytest.mark.parametrize("sample_path", [pytest.param(RECORD_FAILURE, id="record-failure")]) +def test_record_failure(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + skip_recording = pytestconfig.getoption("azure_skip_live_recording") == "true" + if live and not skip_recording: + pytest.fail("synthetic recording failure") + (ROOT / "playback-after-record-failure.txt").write_text("played", encoding="utf-8") + + +@pytest.mark.parametrize("sample_path", [pytest.param(PLAYBACK_FAILURE, id="playback-failure")]) +def test_playback_failure(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + skip_recording = pytestconfig.getoption("azure_skip_live_recording") == "true" + if not live and skip_recording: + pytest.fail("synthetic playback failure") + + +@pytest.mark.parametrize("sample_path", [pytest.param(HOSTED, id="hosted-case")]) +def test_hosted(sample_path, pytestconfig): + live = pytestconfig.getoption("azure_test_run_live") == "true" + if not live: + assert (ROOT / "tests" / "samples" / "repair-called.txt").is_file() +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\test_samples.py") -Encoding UTF8 + + @' +from pathlib import Path +import sys + +Path(__file__).with_name("repair-called.txt").write_text(sys.argv[1], encoding="utf-8") +print("synthetic repair completed") +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\repair_hosted_agent_sample_recording.py") -Encoding UTF8 + + @' +from pathlib import Path +import pytest + +ROOT = Path(__file__).resolve().parents[2] +ASYNC_SAMPLE = str(ROOT / "samples" / "async" / "sample_async.py") + + +@pytest.mark.parametrize("sample_path", [pytest.param(ASYNC_SAMPLE, id="async-case")]) +async def test_async(sample_path): + pass +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\test_samples_async.py") -Encoding UTF8 + + @' +from pathlib import Path +import pytest + +ROOT = Path(__file__).resolve().parents[2] +EVALUATION_SAMPLE = str(ROOT / "samples" / "evaluations" / "sample_evaluation.py") + + +@pytest.mark.parametrize("sample_path", [pytest.param(EVALUATION_SAMPLE, id="evaluation-case")]) +def test_evaluation(sample_path): + pass +'@ | Set-Content -LiteralPath (Join-Path $Root "tests\samples\test_samples_evaluations.py") -Encoding UTF8 +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 new file mode 100644 index 000000000000..d0401817c6a7 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-record-sample/tests/TestRecordingGitConflicts.Tests.ps1 @@ -0,0 +1,149 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +. (Join-Path $PSScriptRoot "TestHelpers.ps1") +$paths = Get-RecordSampleTestPaths $PSScriptRoot + +function Invoke-TestGit { + param([string]$Root, [Parameter(ValueFromRemainingArguments = $true)][string[]]$Arguments) + $output = @(& git -C $Root @Arguments 2>&1) + if ($LASTEXITCODE -ne 0) { + throw "git $($Arguments -join ' ') failed: $($output -join [Environment]::NewLine)" + } + ($output -join [Environment]::NewLine).Trim() +} + +function Initialize-TestRepository { + param([string]$Root) + New-Item -ItemType Directory -Path $Root -Force | Out-Null + Invoke-TestGit $Root init --initial-branch=main | Out-Null + Invoke-TestGit $Root config user.email test@example.com | Out-Null + Invoke-TestGit $Root config user.name "Recording Guard Tests" | Out-Null +} + +function Write-TestAssetsFile { + param([string]$PackageRoot, [string]$Tag) + [ordered]@{ + AssetsRepo = "Test/assets" + AssetsRepoPrefixPath = "python" + TagPrefix = "python/ai/azure-ai-projects" + Tag = $Tag + } | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $PackageRoot "assets.json") -Encoding UTF8 +} + +function New-GuardRepositories { + param([string]$Root) + + $sourceRoot = Join-Path $Root "source" + $packageRoot = Join-Path $sourceRoot "sdk\ai\azure-ai-projects" + $assetsRoot = Join-Path $Root "assets" + Initialize-TestRepository $sourceRoot + New-Item -ItemType Directory -Path $packageRoot -Force | Out-Null + Write-TestAssetsFile $packageRoot "asset-base" + Invoke-TestGit $sourceRoot add . | Out-Null + Invoke-TestGit $sourceRoot commit -m "base assets" | Out-Null + + Initialize-TestRepository $assetsRoot + "base" | Set-Content -LiteralPath (Join-Path $assetsRoot "recording.txt") -Encoding UTF8 + Invoke-TestGit $assetsRoot add . | Out-Null + Invoke-TestGit $assetsRoot commit -m "base recording" | Out-Null + Invoke-TestGit $assetsRoot tag asset-base | Out-Null + + [pscustomobject]@{ + SourceRoot = $sourceRoot + PackageRoot = $packageRoot + AssetsRoot = $assetsRoot + } +} + +Describe "TestRecordingGitConflicts.ps1" { + It "allows recording on a current base branch with the same asset tag" { + $repos = New-GuardRepositories (Join-Path $TestDrive "equal-base") + $actual = & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + + $actual.SafeToRecord | Should Be $true + $actual.AssetRelationship | Should Be "same" + } + + It "allows a topic branch rebased onto the base with the same asset tag" { + $repos = New-GuardRepositories (Join-Path $TestDrive "topic-equal") + Invoke-TestGit $repos.SourceRoot checkout -b topic | Out-Null + "topic" | Set-Content -LiteralPath (Join-Path $repos.SourceRoot "topic.txt") -Encoding UTF8 + Invoke-TestGit $repos.SourceRoot add . | Out-Null + Invoke-TestGit $repos.SourceRoot commit -m "topic work" | Out-Null + + $actual = & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + + $actual.SafeToRecord | Should Be $true + $actual.AssetRelationship | Should Be "same" + } + + It "allows a descendant local asset tag on the base branch" { + $repos = New-GuardRepositories (Join-Path $TestDrive "asset-descendant") + "new" | Set-Content -LiteralPath (Join-Path $repos.AssetsRoot "recording.txt") -Encoding UTF8 + Invoke-TestGit $repos.AssetsRoot add . | Out-Null + Invoke-TestGit $repos.AssetsRoot commit -m "new recording" | Out-Null + Invoke-TestGit $repos.AssetsRoot tag asset-new | Out-Null + Write-TestAssetsFile $repos.PackageRoot "asset-new" + + $actual = & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + + $actual.SafeToRecord | Should Be $true + $actual.AssetRelationship | Should Be "descendant" + $actual.BaseAssetCommitDate | Should Not BeNullOrEmpty + $actual.LocalAssetCommitDate | Should Not BeNullOrEmpty + } + + It "blocks a divergent local asset tag" { + $repos = New-GuardRepositories (Join-Path $TestDrive "asset-divergent") + Invoke-TestGit $repos.AssetsRoot checkout --orphan divergent | Out-Null + Invoke-TestGit $repos.AssetsRoot rm -rf . | Out-Null + "divergent" | Set-Content -LiteralPath (Join-Path $repos.AssetsRoot "recording.txt") -Encoding UTF8 + Invoke-TestGit $repos.AssetsRoot add . | Out-Null + Invoke-TestGit $repos.AssetsRoot commit -m "divergent recording" | Out-Null + Invoke-TestGit $repos.AssetsRoot tag asset-divergent | Out-Null + Write-TestAssetsFile $repos.PackageRoot "asset-divergent" + $caught = $null + try { + & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + } catch { $caught = $_ } + + $caught.Exception.Message | Should Match "not descended from base tag" + } + + It "blocks a topic branch that does not contain the selected base" { + $repos = New-GuardRepositories (Join-Path $TestDrive "stale-topic") + Invoke-TestGit $repos.SourceRoot checkout -b topic | Out-Null + "topic" | Set-Content -LiteralPath (Join-Path $repos.SourceRoot "topic.txt") -Encoding UTF8 + Invoke-TestGit $repos.SourceRoot add . | Out-Null + Invoke-TestGit $repos.SourceRoot commit -m "topic work" | Out-Null + Invoke-TestGit $repos.SourceRoot checkout main | Out-Null + "new base" | Set-Content -LiteralPath (Join-Path $repos.SourceRoot "base.txt") -Encoding UTF8 + Invoke-TestGit $repos.SourceRoot add . | Out-Null + Invoke-TestGit $repos.SourceRoot commit -m "advance base" | Out-Null + Invoke-TestGit $repos.SourceRoot checkout topic | Out-Null + $caught = $null + try { + & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot -BaseBranch main ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + } catch { $caught = $_ } + + $caught.Exception.Message | Should Match "does not contain the latest 'main'" + } + + It "requires explicit base selection on a topic branch" { + $repos = New-GuardRepositories (Join-Path $TestDrive "missing-base") + Invoke-TestGit $repos.SourceRoot checkout -b topic | Out-Null + $caught = $null + try { + & $paths.RecordingConflictCheck -PackageRoot $repos.PackageRoot ` + -AssetsRepositoryPath $repos.AssetsRoot -SkipFetch + } catch { $caught = $_ } + + $caught.Exception.Message | Should Match "BaseBranch is required" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/tests/conftest.py b/sdk/ai/azure-ai-projects/tests/conftest.py index d3eaf64184e4..4f417dc331ff 100644 --- a/sdk/ai/azure-ai-projects/tests/conftest.py +++ b/sdk/ai/azure-ai-projects/tests/conftest.py @@ -13,6 +13,7 @@ import os import re +import sys import pytest from dotenv import find_dotenv, load_dotenv from devtools_testutils import ( @@ -24,12 +25,55 @@ add_body_key_sanitizer, add_remove_header_sanitizer, ) +from devtools_testutils.proxy_startup import test_proxy from agent_insights.sanitizers import add_agent_insights_sanitizers +from test_base import servicePreparer -if not load_dotenv(find_dotenv(), override=True): +_SERVICE_PREPARER_DEFAULTS = servicePreparer.keywords or {} +_CLI_ENV_OPTIONS = { + **{option_name: option_name.upper() for option_name in _SERVICE_PREPARER_DEFAULTS}, + "azure_test_run_live": "AZURE_TEST_RUN_LIVE", + "azure_skip_live_recording": "AZURE_SKIP_LIVE_RECORDING", +} + + +def _has_cli_env_options() -> bool: + option_names = {f"--{option_name}" for option_name in _CLI_ENV_OPTIONS} | { + f"--{option_name.replace('_', '-')}" for option_name in _CLI_ENV_OPTIONS + } + return any(argument.split("=", 1)[0] in option_names for argument in sys.argv[1:]) + + +_CLI_ENV_MODE = _has_cli_env_options() +if _CLI_ENV_MODE: + os.environ["PYTHON_DOTENV_DISABLED"] = "true" +elif not load_dotenv(find_dotenv(), override=True): print("Did not find a .env file. Using default environment variable values for tests.") +def pytest_addoption(parser): + group = parser.getgroup("azure-ai-projects environment") + for option_name in _CLI_ENV_OPTIONS: + group.addoption( + f"--{option_name}", + f"--{option_name.replace('_', '-')}", + dest=option_name, + help=f"Set the {option_name.upper()} environment variable.", + ) + + +def pytest_configure(config): + if not _CLI_ENV_MODE: + return + + for option_name, environment_variable in _CLI_ENV_OPTIONS.items(): + value = config.getoption(option_name) + if value is None: + value = _SERVICE_PREPARER_DEFAULTS.get(option_name) + if value is not None: + os.environ[environment_variable] = value + + def pytest_collection_modifyitems(items): if os.environ.get("AZURE_TEST_RUN_LIVE") == "true": return From f13817695248301d34b2c58cdb37a13f634e7a33 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 23 Oct 2026 12:18:41 -0700 Subject: [PATCH 07/20] Part 1: Regenerate GPT Live ownership models from TypeSpec e30cf6f Use the latest Azure/azure-rest-api-specs PR 47196 commit, including effective Foundry delegation ownership in Live lifecycle and delegation events. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-ai-projects/apiview-properties.json | 6 +- .../ai/projects/aio/operations/_operations.py | 18 +- .../azure/ai/projects/models/__init__.py | 8 +- .../azure/ai/projects/models/_enums.py | 11 +- .../azure/ai/projects/models/_models.py | 392 +++++++++--------- .../ai/projects/operations/_operations.py | 18 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 7 files changed, 244 insertions(+), 211 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 3ca298f3ec7c..29ace4bd4900 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -306,7 +306,6 @@ "azure.ai.projects.models.LiveContextWindowUsage": "OpenAI.LiveContextWindowUsage", "azure.ai.projects.models.LiveCustomVoiceParam": "OpenAI.LiveCustomVoiceParam", "azure.ai.projects.models.LiveDataChannelConfigParam": "OpenAI.LiveDataChannelConfigParam", - "azure.ai.projects.models.LiveDelegationItem": "OpenAI.LiveDelegationItem", "azure.ai.projects.models.LiveDelegationReasoningInputParam": "OpenAI.LiveDelegationReasoningInputParam", "azure.ai.projects.models.LiveDelegationTextInputParam": "OpenAI.LiveDelegationTextInputParam", "azure.ai.projects.models.LiveFunctionToolChoiceParam": "OpenAI.LiveFunctionToolChoiceParam", @@ -348,7 +347,6 @@ "azure.ai.projects.models.LiveSessionAudioFormatPCMParam": "OpenAI.LiveSessionAudioFormatPCMParam", "azure.ai.projects.models.LiveSessionAudioFormatPCMUParam": "OpenAI.LiveSessionAudioFormatPCMUParam", "azure.ai.projects.models.LiveSessionCreateParams": "OpenAI.LiveSessionCreateParams", - "azure.ai.projects.models.LiveSessionResourceParam": "OpenAI.LiveSessionResourceParam", "azure.ai.projects.models.LiveSessionStartEvent": "OpenAI.LiveSessionStartEvent", "azure.ai.projects.models.LiveSessionUpdateParams": "OpenAI.LiveSessionUpdateParams", "azure.ai.projects.models.LiveSessionUsage": "OpenAI.LiveSessionUsage", @@ -687,6 +685,7 @@ "azure.ai.projects.models.VoiceAgentLiveClientDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveClientDelegationConversationItem", "azure.ai.projects.models.VoiceAgentLiveConversation": "Azure.AI.Projects.VoiceAgentLiveConversation", "azure.ai.projects.models.VoiceAgentLiveDefinition": "Azure.AI.Projects.VoiceAgentLiveDefinition", + "azure.ai.projects.models.VoiceAgentLiveDelegationItem": "Azure.AI.Projects.VoiceAgentLiveDelegationItem", "azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1": "Azure.AI.Projects.VoiceAgentLiveDelegationResultItem.anonymous", "azure.ai.projects.models.VoiceAgentLiveDelegationResultItem2": "Azure.AI.Projects.VoiceAgentLiveDelegationResultItem.anonymous", "azure.ai.projects.models.VoiceAgentLiveFoundryManagedAgentDelegationItem": "Azure.AI.Projects.VoiceAgentLiveFoundryManagedAgentDelegationItem", @@ -694,6 +693,7 @@ "azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation": "Azure.AI.Projects.VoiceAgentLiveManagedAgentDelegation", "azure.ai.projects.models.VoiceAgentLiveOutputConversationItem": "Azure.AI.Projects.VoiceAgentLiveOutputConversationItem", "azure.ai.projects.models.VoiceAgentLiveResponsesDelegationConversationItem": "Azure.AI.Projects.VoiceAgentLiveResponsesDelegationConversationItem", + "azure.ai.projects.models.VoiceAgentLiveSessionResource": "Azure.AI.Projects.VoiceAgentLiveSessionResource", "azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig": "Azure.AI.Projects.VoiceAgentLlmGeneratedGreetingConfig", "azure.ai.projects.models.VoiceAgentLlmInterimResponseConfig": "Azure.AI.Projects.VoiceAgentLlmInterimResponseConfig", "azure.ai.projects.models.VoiceAgentMcpTool": "Azure.AI.Projects.VoiceAgentMcpTool", @@ -1100,5 +1100,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "f075953027d8" + "CrossLanguageVersion": "3c64f94d6c46" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index 56548426f018..60ab74a8a990 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -2171,23 +2171,29 @@ async def get_session_log_stream( Each SSE frame contains: * `event`: always `"log"` - * `data`: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string) + * `data`: a plain-text log line (currently JSON-formatted, but the schema + is not contractual and may include additional keys or change format + over time — clients should treat it as an opaque string) Example SSE frames: .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting + FoundryCBAgent server on port 8088"} event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application + startup complete."} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully + connected to container"} event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since + last 60 seconds"} The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed. @@ -2229,7 +2235,7 @@ async def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index 56688b3fadc9..92f6125bf459 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -308,7 +308,6 @@ LiveContextWindowUsage, LiveCustomVoiceParam, LiveDataChannelConfigParam, - LiveDelegationItem, LiveDelegationReasoningInputParam, LiveDelegationTextInputParam, LiveFunctionToolChoiceParam, @@ -350,7 +349,6 @@ LiveSessionAudioFormatPCMParam, LiveSessionAudioFormatPCMUParam, LiveSessionCreateParams, - LiveSessionResourceParam, LiveSessionStartEvent, LiveSessionUpdateParams, LiveSessionUsage, @@ -698,6 +696,7 @@ VoiceAgentLiveConversationItem, VoiceAgentLiveDefinition, VoiceAgentLiveDelegationConversationItem, + VoiceAgentLiveDelegationItem, VoiceAgentLiveDelegationResultItem1, VoiceAgentLiveDelegationResultItem2, VoiceAgentLiveFoundryManagedAgentDelegationItem, @@ -705,6 +704,7 @@ VoiceAgentLiveManagedAgentDelegation, VoiceAgentLiveOutputConversationItem, VoiceAgentLiveResponsesDelegationConversationItem, + VoiceAgentLiveSessionResource, VoiceAgentLlmGeneratedGreetingConfig, VoiceAgentLlmInterimResponseConfig, VoiceAgentMcpTool, @@ -1259,7 +1259,6 @@ "LiveContextWindowUsage", "LiveCustomVoiceParam", "LiveDataChannelConfigParam", - "LiveDelegationItem", "LiveDelegationReasoningInputParam", "LiveDelegationTextInputParam", "LiveFunctionToolChoiceParam", @@ -1301,7 +1300,6 @@ "LiveSessionAudioFormatPCMParam", "LiveSessionAudioFormatPCMUParam", "LiveSessionCreateParams", - "LiveSessionResourceParam", "LiveSessionStartEvent", "LiveSessionUpdateParams", "LiveSessionUsage", @@ -1649,6 +1647,7 @@ "VoiceAgentLiveConversationItem", "VoiceAgentLiveDefinition", "VoiceAgentLiveDelegationConversationItem", + "VoiceAgentLiveDelegationItem", "VoiceAgentLiveDelegationResultItem1", "VoiceAgentLiveDelegationResultItem2", "VoiceAgentLiveFoundryManagedAgentDelegationItem", @@ -1656,6 +1655,7 @@ "VoiceAgentLiveManagedAgentDelegation", "VoiceAgentLiveOutputConversationItem", "VoiceAgentLiveResponsesDelegationConversationItem", + "VoiceAgentLiveSessionResource", "VoiceAgentLlmGeneratedGreetingConfig", "VoiceAgentLlmInterimResponseConfig", "VoiceAgentMcpTool", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 4030e4ed31e9..1437d815e661 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -2852,10 +2852,13 @@ class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The lifecycle status of a persisted voice conversation: - * `in_progress`: the live session is active, or post-session persistence finalization is pending. - * `completed`: finalization succeeded after normal or client close, `end_conversation`, a max-duration `1001` close, - or a client or network disconnect that the service can still finalize. - * `failed`: a terminal service, bridge, storage, or unrecoverable transport failure prevented finalization. + * `in_progress`: the live session is active, or post-session persistence finalization is + pending. + * `completed`: finalization succeeded after normal or client close, `end_conversation`, a + max-duration `1001` + close, or a client or network disconnect that the service can still finalize. + * `failed`: a terminal service, bridge, storage, or unrecoverable transport failure prevented + finalization. """ IN_PROGRESS = "in_progress" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index fc8d967e58bc..b1fa5338a1ec 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -6942,7 +6942,6 @@ class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-matc * `in`: in * `nin`: not in. Required. Is one of the following types: Literal["eq"], Literal["ne"], Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] - :vartype type: str or str or str or str or str or str or str or str :ivar key: The key to compare against the value. Required. :vartype key: str @@ -14180,58 +14179,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveDelegationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Metadata for work delegated by the Live model. Client delegations are handled by your - application; Responses delegations run on the configured backend. - - :ivar id: The unique ID of the delegation. Use this as delegation_id when replying to - client-owned work or correlating Responses events. Required. - :vartype id: str - :ivar type: The object type, always ``delegation``. Required. Default value is "delegation". - :vartype type: str - :ivar target: Where the Live model delegated the work: ``client`` for your application, or - ``responses`` for the configured Responses backend. Required. Is either a Literal["client"] - type or a Literal["responses"] type. - :vartype target: str or str - :ivar response_id: The ID of the Responses API response associated with a Responses delegation. - Omitted for client delegations. - :vartype response_id: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the delegation. Use this as delegation_id when replying to client-owned work - or correlating Responses events. Required.""" - type: Literal["delegation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type, always ``delegation``. Required. Default value is \"delegation\".""" - target: Literal["client", "responses"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Where the Live model delegated the work: ``client`` for your application, or ``responses`` for - the configured Responses backend. Required. Is either a Literal[\"client\"] type or a - Literal[\"responses\"] type.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Responses API response associated with a Responses delegation. Omitted for client - delegations.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - target: Literal["client", "responses"], - response_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["delegation"] = "delegation" - - class LiveDelegationReasoningInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Reasoning options for Responses requests made on behalf of the Live session. @@ -15411,7 +15358,7 @@ class LiveServerEventLiveDelegationCreated( :vartype offset_ms: int :ivar delegation: The delegated work identifier and destination. This object contains metadata, not the task text. Required. - :vartype delegation: ~azure.ai.projects.models.LiveDelegationItem + :vartype delegation: ~azure.ai.projects.models.VoiceAgentLiveDelegationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -15423,7 +15370,9 @@ class LiveServerEventLiveDelegationCreated( offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The position on the Live session timeline where the delegation was created, in milliseconds from the beginning of the session. Required.""" - delegation: "_models.LiveDelegationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + delegation: "_models.VoiceAgentLiveDelegationItem" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The delegated work identifier and destination. This object contains metadata, not the task text. Required.""" @@ -15433,7 +15382,7 @@ def __init__( *, event_id: str, offset_ms: int, - delegation: "_models.LiveDelegationItem", + delegation: "_models.VoiceAgentLiveDelegationItem", client_event_id: Optional[str] = None, ) -> None: ... @@ -15901,7 +15850,7 @@ class LiveServerEventLiveSessionClosed( Literal["connection_lost"] :vartype reason: str or str or str or str or str :ivar session: Required. - :vartype session: ~azure.ai.projects.models.LiveSessionResourceParam + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource :ivar usage: The final cumulative Live audio usage after session finalization. Required. :vartype usage: ~azure.ai.projects.models.LiveSessionUsage """ @@ -15921,7 +15870,9 @@ class LiveServerEventLiveSessionClosed( disconnection. Required. Is one of the following types: Literal[\"close_requested\"], Literal[\"expired\"], Literal[\"content\"], Literal[\"remote_hangup\"], Literal[\"connection_lost\"]""" - session: "_models.LiveSessionResourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + session: "_models.VoiceAgentLiveSessionResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Required.""" usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The final cumulative Live audio usage after session finalization. Required.""" @@ -15932,7 +15883,7 @@ def __init__( *, event_id: str, reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], - session: "_models.LiveSessionResourceParam", + session: "_models.VoiceAgentLiveSessionResource", usage: "_models.LiveSessionUsage", client_event_id: Optional[str] = None, ) -> None: ... @@ -15963,7 +15914,7 @@ class LiveServerEventLiveSessionStarted( when supplied. :vartype client_event_id: str :ivar session: Required. - :vartype session: ~azure.ai.projects.models.LiveSessionResourceParam + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource :ivar conversation_id: Stored conversation ID when effective store is true. Use protocols/voice/live/conversations; this ID differs from session.id. :vartype conversation_id: str @@ -15975,7 +15926,9 @@ class LiveServerEventLiveSessionStarted( """The unique ID of the Live server event. Required.""" client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The event_id of the client command associated with this server event, when supplied.""" - session: "_models.LiveSessionResourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + session: "_models.VoiceAgentLiveSessionResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Required.""" conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Stored conversation ID when effective store is true. Use protocols/voice/live/conversations; @@ -15986,7 +15939,7 @@ def __init__( self, *, event_id: str, - session: "_models.LiveSessionResourceParam", + session: "_models.VoiceAgentLiveSessionResource", client_event_id: Optional[str] = None, conversation_id: Optional[str] = None, ) -> None: ... @@ -16017,7 +15970,7 @@ class LiveServerEventLiveSessionUpdated( when supplied. :vartype client_event_id: str :ivar session: Required. - :vartype session: ~azure.ai.projects.models.LiveSessionResourceParam + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource """ type: Literal[LiveServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -16026,7 +15979,9 @@ class LiveServerEventLiveSessionUpdated( """The unique ID of the Live server event. Required.""" client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The event_id of the client command associated with this server event, when supplied.""" - session: "_models.LiveSessionResourceParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + session: "_models.VoiceAgentLiveSessionResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Required.""" @overload @@ -16034,7 +15989,7 @@ def __init__( self, *, event_id: str, - session: "_models.LiveSessionResourceParam", + session: "_models.VoiceAgentLiveSessionResource", client_event_id: Optional[str] = None, ) -> None: ... @@ -16346,103 +16301,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveSessionResourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The resolved Live session configuration and server-assigned session metadata. - - :ivar model: Required. "gpt-live-1" - :vartype model: str or ~azure.ai.projects.models.ModelIdsLive - :ivar instructions: - :vartype instructions: str - :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and - assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in - total. - :vartype input: list[~azure.ai.projects.models.LiveInitialItem] - :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC - and SIP negotiate their media format. Voice and format are immutable after startup. - :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam - :ivar delegation: Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam - type. - :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or - ~azure.ai.projects.models.LiveResponsesDelegationParam - :ivar store: Whether to store the session for later forking and recording download. Defaults to - false for new sessions. - :vartype store: bool - :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC - session. Trusted sideband connections are unaffected. - :vartype client: ~azure.ai.projects.models.LiveClientConfigParam - :ivar id: The unique ID of the Live session. Use this ID for sideband connections, forking, and - recording download. Required. - :vartype id: str - :ivar expires_at: The Unix timestamp, in seconds, at which the Live session expires. Required. - :vartype expires_at: int - :ivar status: The status of the session snapshot. Always ``active``, including the final - snapshot in session.closed; use the event type to determine that the session has closed. - Required. Default value is "active". - :vartype status: str - """ - - model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. \"gpt-live-1\"""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input: Optional[list["_models.LiveInitialItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Ordered text-only history supplied before startup. Supports developer, user, and assistant - messages with one text part each; at most 128 messages and 8,192 rendered tokens in total.""" - audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP - negotiate their media format. Voice and format are immutable after startup.""" - delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam type.""" - store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to store the session for later forking and recording download. Defaults to false for - new sessions.""" - client: Optional["_models.LiveClientConfigParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. - Trusted sideband connections are unaffected.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live session. Use this ID for sideband connections, forking, and recording - download. Required.""" - expires_at: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Unix timestamp, in seconds, at which the Live session expires. Required.""" - status: Literal["active"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The status of the session snapshot. Always ``active``, including the final snapshot in - session.closed; use the event type to determine that the session has closed. Required. Default - value is \"active\".""" - - @overload - def __init__( - self, - *, - model: Union[str, "_models.ModelIdsLive"], - id: str, # pylint: disable=redefined-builtin - expires_at: int, - instructions: Optional[str] = None, - input: Optional[list["_models.LiveInitialItem"]] = None, - audio: Optional["_models.LiveInitialSessionAudioParam"] = None, - delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = None, - store: Optional[bool] = None, - client: Optional["_models.LiveClientConfigParam"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.status: Literal["active"] = "active" - - class LiveSessionStartEvent( LiveClientEvent, discriminator="session.start" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -17161,7 +17019,6 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s Literal["connector_googledrive"], Literal["connector_microsoftteams"], Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], Literal["connector_sharepoint"] - :vartype connector_id: str or str or str or str or str or str or str or str :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. @@ -17341,7 +17198,6 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst Literal["connector_googledrive"], Literal["connector_microsoftteams"], Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], Literal["connector_sharepoint"] - :vartype connector_id: str or str or str or str or str or str or str or str :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. @@ -22612,12 +22468,14 @@ class RealtimeServerEventConversationItemAdded( several cases: * When the client sends a `conversation.item.create` event. - * When the input audio buffer is committed. In this case the item will be a user message containing the audio from - the buffer. - * When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the - model starts generating a specific Item, and thus it will not yet have any content (and `status` will be - `in_progress`). The event will include the full content of the Item (except when model is generating a Response) - except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. + * When the input audio buffer is committed. In this case the item will be a user message + containing the audio from the buffer. + * When the model is generating a Response. In this case the `conversation.item.added` event + will be sent when the model starts generating a specific Item, and thus it will not yet have + any content (and `status` will be `in_progress`). + The event will include the full content of the Item (except when model is generating a + Response) except for audio data, which can be retrieved separately with a + `conversation.item.retrieve` event if necessary. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -22665,11 +22523,14 @@ class RealtimeServerEventConversationItemCreated( """Returned when a conversation item is created. There are several scenarios that produce this event: - * The server is generating a Response, which if successful will produce either one or two Items, which will be of - type `message` (role `assistant`) or type `function_call`. - * The input audio buffer has been committed, either by the client or the server (in `server_vad` mode). The server - will take the content of the input audio buffer and add it to a new user message Item. - * The client has sent a `conversation.item.create` event to add a new Item to the Conversation. + * The server is generating a Response, which if successful will produce + either one or two Items, which will be of type `message` + (role `assistant`) or type `function_call`. + * The input audio buffer has been committed, either by the client or the + server (in `server_vad` mode). The server will take the content of the + input audio buffer and add it to a new user message Item. + * The client has sent a `conversation.item.create` event to add a new Item + to the Conversation. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -26322,10 +26183,12 @@ class SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server + on port 18080"} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully + connected to container"} :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in the future. Clients should ignore unrecognized event types. Required. "log" @@ -31257,14 +31120,15 @@ class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword- Provider-specific fields are selected by ``voice_type``: * `openai`: `voice` and `speed`. - * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, - `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. + * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, + `custom_lexicon_url`, + `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. * `azure-custom`: all `azure-standard` fields except `style`, plus `custom_voice_endpoint_id`. * `azure-personal`: all `azure-standard` fields except `style`, plus `personal_voice_model`. - * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus `personal_voice_model`; the - voice name is derived from the avatar. - * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice - type. + * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus + `personal_voice_model`; the voice name is derived from the avatar. + * `azure-realtime-native`: `voice` and `speed`. + `format` and `output_audio_timestamp_types` apply to every voice type. :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM. @@ -32317,9 +32181,7 @@ class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstri :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig """ - sub_protocol: Optional[Literal["realtime"]] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + sub_protocol: Optional[Literal["realtime"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Selects Realtime. May be omitted for legacy agents. Default value is \"realtime\".""" model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -33197,10 +33059,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sub_protocol: Literal["live"] = "live" # pyright: ignore[reportIncompatibleVariableOverride] + self.sub_protocol: Literal["live"] = "live" self.model_type: Literal["self_deployed"] = "self_deployed" +class VoiceAgentLiveDelegationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Live delegation trigger metadata reported to Foundry clients. This object contains metadata, + not the task text. + + :ivar id: The unique ID of the delegation. Use this as delegation_id when replying to + client-owned work or correlating Responses events. Required. + :vartype id: str + :ivar type: The object type, always ``delegation``. Required. Default value is "delegation". + :vartype type: str + :ivar response_id: The ID of the Responses API response associated with a Responses delegation. + Omitted for client delegations. + :vartype response_id: str + :ivar target: Where the work is handled. foundry_managed_agent sessions report + foundry_managed_agent; GPT Live itself uses client. Required. Known values are: "responses", + "client", and "foundry_managed_agent". + :vartype target: str or ~azure.ai.projects.models.VoiceAgentLiveDelegationTarget + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the delegation. Use this as delegation_id when replying to client-owned work + or correlating Responses events. Required.""" + type: Literal["delegation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type, always ``delegation``. Required. Default value is \"delegation\".""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Responses API response associated with a Responses delegation. Omitted for client + delegations.""" + target: Union[str, "_models.VoiceAgentLiveDelegationTarget"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Where the work is handled. foundry_managed_agent sessions report foundry_managed_agent; GPT + Live itself uses client. Required. Known values are: \"responses\", \"client\", and + \"foundry_managed_agent\".""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + target: Union[str, "_models.VoiceAgentLiveDelegationTarget"], + response_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["delegation"] = "delegation" + + class VoiceAgentLiveDelegationResultItem1(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """VoiceAgentLiveDelegationResultItem1. @@ -33537,6 +33453,108 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = VoiceAgentLiveDelegationTarget.RESPONSES # type: ignore +class VoiceAgentLiveSessionResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Live session resource reported to Foundry clients. GPT Live runs native client delegation for + foundry_managed_agent sessions; Foundry reports the effective owner. + + :ivar model: Required. "gpt-live-1" + :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar instructions: + :vartype instructions: str + :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and + assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in + total. + :vartype input: list[~azure.ai.projects.models.LiveInitialItem] + :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC + and SIP negotiate their media format. Voice and format are immutable after startup. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar store: Whether to store the session for later forking and recording download. Defaults to + false for new sessions. + :vartype store: bool + :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC + session. Trusted sideband connections are unaffected. + :vartype client: ~azure.ai.projects.models.LiveClientConfigParam + :ivar id: The unique ID of the Live session. Use this ID for sideband connections, forking, and + recording download. Required. + :vartype id: str + :ivar expires_at: The Unix timestamp, in seconds, at which the Live session expires. Required. + :vartype expires_at: int + :ivar status: The status of the session snapshot. Always ``active``, including the final + snapshot in session.closed; use the event type to determine that the session has closed. + Required. Default value is "active". + :vartype status: str + :ivar delegation: Delegation owner. foundry_managed_agent sessions report the pinned target, + including the resolved agent_version. Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam or + ~azure.ai.projects.models.VoiceAgentLiveManagedAgentDelegation + """ + + model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. \"gpt-live-1\"""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.LiveInitialItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ordered text-only history supplied before startup. Supports developer, user, and assistant + messages with one text part each; at most 128 messages and 8,192 rendered tokens in total.""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to store the session for later forking and recording download. Defaults to false for + new sessions.""" + client: Optional["_models.LiveClientConfigParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live session. Use this ID for sideband connections, forking, and recording + download. Required.""" + expires_at: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Unix timestamp, in seconds, at which the Live session expires. Required.""" + status: Literal["active"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status of the session snapshot. Always ``active``, including the final snapshot in + session.closed; use the event type to determine that the session has closed. Required. Default + value is \"active\".""" + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Delegation owner. foundry_managed_agent sessions report the pinned target, including the + resolved agent_version. Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationParam, VoiceAgentLiveManagedAgentDelegation""" + + @overload + def __init__( + self, + *, + model: Union[str, "_models.ModelIdsLive"], + id: str, # pylint: disable=redefined-builtin + expires_at: int, + instructions: Optional[str] = None, + input: Optional[list["_models.LiveInitialItem"]] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + store: Optional[bool] = None, + client: Optional["_models.LiveClientConfigParam"] = None, + delegation: Optional["_unions.VoiceAgentLiveDelegation"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.status: Literal["active"] = "active" + + class VoiceAgentLlmGeneratedGreetingConfig( VoiceAgentGreetingConfig, discriminator="llm_generated" ): # pylint: disable=docstring-keyword-should-match-keyword-only diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index d5a334362a82..5bd8f1ea1a92 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -7343,23 +7343,29 @@ def get_session_log_stream( Each SSE frame contains: * `event`: always `"log"` - * `data`: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string) + * `data`: a plain-text log line (currently JSON-formatted, but the schema + is not contractual and may include additional keys or change format + over time — clients should treat it as an opaque string) Example SSE frames: .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting + FoundryCBAgent server on port 8088"} event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application + startup complete."} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully + connected to container"} event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since + last 60 seconds"} The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed. @@ -7401,7 +7407,7 @@ def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 0736db91c329..e2153981af91 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: c929d7f888525c9ddffe218a07cd6fc76f3d3610 +commit: e30cf6f0dcfbca167edf731d4e48874a63639e8b repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 7c8474c8d096be144bdc1a21dc56869d723eced4 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 23 Oct 2026 12:31:20 -0700 Subject: [PATCH 08/20] Part 2: Apply post-emitter fixes and refresh Live API artifacts Preserve generated API markdown formatting and its matching metadata hash; restore the existing SDK post-emitter corrections without changing their behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/api.md | 116 +++++++++--------- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../ai/projects/aio/operations/_operations.py | 18 +-- .../azure/ai/projects/models/_enums.py | 11 +- .../azure/ai/projects/models/_models.py | 55 ++++----- .../ai/projects/operations/_operations.py | 18 +-- 6 files changed, 101 insertions(+), 119 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 794ea298e6d7..15b80957ad56 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -9116,25 +9116,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveDelegationItem(_Model): - id: str - response_id: Optional[str] - target: Literal["client", "responses"] - type: Literal["delegation"] - - @overload - def __init__( - self, - *, - id: str, - response_id: Optional[str] = ..., - target: Literal["client", "responses"] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.LiveDelegationReasoningInputParam(_Model): effort: Optional[Union[str, LiveReasoningEffort]] summary: Optional[Union[str, LiveReasoningSummary]] @@ -9590,7 +9571,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.LiveServerEventLiveDelegationCreated(LiveServerEvent, discriminator='session.delegation.created'): client_event_id: Optional[str] - delegation: LiveDelegationItem + delegation: VoiceAgentLiveDelegationItem event_id: str offset_ms: int type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] @@ -9600,7 +9581,7 @@ namespace azure.ai.projects.models self, *, client_event_id: Optional[str] = ..., - delegation: LiveDelegationItem, + delegation: VoiceAgentLiveDelegationItem, event_id: str, offset_ms: int ) -> None: ... @@ -9775,7 +9756,7 @@ namespace azure.ai.projects.models client_event_id: Optional[str] event_id: str reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] - session: LiveSessionResourceParam + session: VoiceAgentLiveSessionResource type: Literal[LiveServerEventType.SESSION_CLOSED] usage: LiveSessionUsage @@ -9786,7 +9767,7 @@ namespace azure.ai.projects.models client_event_id: Optional[str] = ..., event_id: str, reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], - session: LiveSessionResourceParam, + session: VoiceAgentLiveSessionResource, usage: LiveSessionUsage ) -> None: ... @@ -9798,7 +9779,7 @@ namespace azure.ai.projects.models client_event_id: Optional[str] conversation_id: Optional[str] event_id: str - session: LiveSessionResourceParam + session: VoiceAgentLiveSessionResource type: Literal[LiveServerEventType.SESSION_STARTED] @overload @@ -9808,7 +9789,7 @@ namespace azure.ai.projects.models client_event_id: Optional[str] = ..., conversation_id: Optional[str] = ..., event_id: str, - session: LiveSessionResourceParam + session: VoiceAgentLiveSessionResource ) -> None: ... @overload @@ -9818,7 +9799,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.LiveServerEventLiveSessionUpdated(LiveServerEvent, discriminator='session.updated'): client_event_id: Optional[str] event_id: str - session: LiveSessionResourceParam + session: VoiceAgentLiveSessionResource type: Literal[LiveServerEventType.SESSION_UPDATED] @overload @@ -9827,7 +9808,7 @@ namespace azure.ai.projects.models *, client_event_id: Optional[str] = ..., event_id: str, - session: LiveSessionResourceParam + session: VoiceAgentLiveSessionResource ) -> None: ... @overload @@ -9972,37 +9953,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveSessionResourceParam(_Model): - audio: Optional[LiveInitialSessionAudioParam] - client: Optional[LiveClientConfigParam] - delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] - expires_at: int - id: str - input: Optional[list[LiveInitialItem]] - instructions: Optional[str] - model: Union[str, ModelIdsLive] - status: Literal["active"] - store: Optional[bool] - - @overload - def __init__( - self, - *, - audio: Optional[LiveInitialSessionAudioParam] = ..., - client: Optional[LiveClientConfigParam] = ..., - delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] = ..., - expires_at: int, - id: str, - input: Optional[list[LiveInitialItem]] = ..., - instructions: Optional[str] = ..., - model: Union[str, ModelIdsLive], - store: Optional[bool] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.LiveSessionStartEvent(LiveClientEvent, discriminator='session.start'): event_id: Optional[str] session: LiveSessionCreateParams @@ -17450,6 +17400,25 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentLiveDelegationItem(_Model): + id: str + response_id: Optional[str] + target: Union[str, VoiceAgentLiveDelegationTarget] + type: Literal["delegation"] + + @overload + def __init__( + self, + *, + id: str, + response_id: Optional[str] = ..., + target: Union[str, VoiceAgentLiveDelegationTarget] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentLiveDelegationResultItem1(_Model): commentary: Optional[str] thinking: str @@ -17607,6 +17576,37 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentLiveSessionResource(_Model): + audio: Optional[LiveInitialSessionAudioParam] + client: Optional[LiveClientConfigParam] + delegation: Optional[VoiceAgentLiveDelegation] + expires_at: int + id: str + input: Optional[list[LiveInitialItem]] + instructions: Optional[str] + model: Union[str, ModelIdsLive] + status: Literal["active"] + store: Optional[bool] + + @overload + def __init__( + self, + *, + audio: Optional[LiveInitialSessionAudioParam] = ..., + client: Optional[LiveClientConfigParam] = ..., + delegation: Optional[VoiceAgentLiveDelegation] = ..., + expires_at: int, + id: str, + input: Optional[list[LiveInitialItem]] = ..., + instructions: Optional[str] = ..., + model: Union[str, ModelIdsLive], + store: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentLlmGeneratedGreetingConfig(VoiceAgentGreetingConfig, discriminator='llm_generated'): prompt: str tool_choice: Optional[VoiceAgentToolChoice] diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index f13e30cf6939..bc57277ae7a9 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: e8c65b5d00eae3440a51d6626ac9a885a01f02fd53dfab0443c3bc54ea8eb5cd +apiHash: 24bfd6b23555262dd875c1af6cc0f446ba0c6d83cc5ed7fe686943ed5c395a0e packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.10 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index 60ab74a8a990..56548426f018 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -2171,29 +2171,23 @@ async def get_session_log_stream( Each SSE frame contains: * `event`: always `"log"` - * `data`: a plain-text log line (currently JSON-formatted, but the schema - is not contractual and may include additional keys or change format - over time — clients should treat it as an opaque string) + * `data`: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string) Example SSE frames: .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting - FoundryCBAgent server on port 8088"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application - startup complete."} + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully - connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since - last 60 seconds"} + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed. @@ -2235,7 +2229,7 @@ async def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 1437d815e661..4030e4ed31e9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -2852,13 +2852,10 @@ class VoiceAudioRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): class VoiceConversationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The lifecycle status of a persisted voice conversation: - * `in_progress`: the live session is active, or post-session persistence finalization is - pending. - * `completed`: finalization succeeded after normal or client close, `end_conversation`, a - max-duration `1001` - close, or a client or network disconnect that the service can still finalize. - * `failed`: a terminal service, bridge, storage, or unrecoverable transport failure prevented - finalization. + * `in_progress`: the live session is active, or post-session persistence finalization is pending. + * `completed`: finalization succeeded after normal or client close, `end_conversation`, a max-duration `1001` close, + or a client or network disconnect that the service can still finalize. + * `failed`: a terminal service, bridge, storage, or unrecoverable transport failure prevented finalization. """ IN_PROGRESS = "in_progress" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index b1fa5338a1ec..7d39afeaebe4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -6942,6 +6942,7 @@ class ComparisonFilter(_Model): # pylint: disable=docstring-keyword-should-matc * `in`: in * `nin`: not in. Required. Is one of the following types: Literal["eq"], Literal["ne"], Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] + :vartype type: str or str or str or str or str or str or str or str :ivar key: The key to compare against the value. Required. :vartype key: str @@ -17019,6 +17020,7 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s Literal["connector_googledrive"], Literal["connector_microsoftteams"], Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], Literal["connector_sharepoint"] + :vartype connector_id: str or str or str or str or str or str or str or str :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. @@ -17198,6 +17200,7 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst Literal["connector_googledrive"], Literal["connector_microsoftteams"], Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], Literal["connector_sharepoint"] + :vartype connector_id: str or str or str or str or str or str or str or str :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. @@ -22468,14 +22471,12 @@ class RealtimeServerEventConversationItemAdded( several cases: * When the client sends a `conversation.item.create` event. - * When the input audio buffer is committed. In this case the item will be a user message - containing the audio from the buffer. - * When the model is generating a Response. In this case the `conversation.item.added` event - will be sent when the model starts generating a specific Item, and thus it will not yet have - any content (and `status` will be `in_progress`). - The event will include the full content of the Item (except when model is generating a - Response) except for audio data, which can be retrieved separately with a - `conversation.item.retrieve` event if necessary. + * When the input audio buffer is committed. In this case the item will be a user message containing the audio from + the buffer. + * When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the + model starts generating a specific Item, and thus it will not yet have any content (and `status` will be + `in_progress`). The event will include the full content of the Item (except when model is generating a Response) + except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -22523,14 +22524,11 @@ class RealtimeServerEventConversationItemCreated( """Returned when a conversation item is created. There are several scenarios that produce this event: - * The server is generating a Response, which if successful will produce - either one or two Items, which will be of type `message` - (role `assistant`) or type `function_call`. - * The input audio buffer has been committed, either by the client or the - server (in `server_vad` mode). The server will take the content of the - input audio buffer and add it to a new user message Item. - * The client has sent a `conversation.item.create` event to add a new Item - to the Conversation. + * The server is generating a Response, which if successful will produce either one or two Items, which will be of + type `message` (role `assistant`) or type `function_call`. + * The input audio buffer has been committed, either by the client or the server (in `server_vad` mode). The server + will take the content of the input audio buffer and add it to a new user message Item. + * The client has sent a `conversation.item.create` event to add a new Item to the Conversation. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -26183,12 +26181,10 @@ class SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server - on port 18080"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully - connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in the future. Clients should ignore unrecognized event types. Required. "log" @@ -31120,15 +31116,14 @@ class VoiceAgentAudioOutputConfig(_Model): # pylint: disable=docstring-keyword- Provider-specific fields are selected by ``voice_type``: * `openai`: `voice` and `speed`. - * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, - `custom_lexicon_url`, - `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. + * `azure-standard`: `voice`, `voice_locale`, `speed`, `voice_temperature`, `custom_lexicon_url`, + `custom_text_normalization_url`, `prefer_locales`, `style`, `pitch`, and `volume`. * `azure-custom`: all `azure-standard` fields except `style`, plus `custom_voice_endpoint_id`. * `azure-personal`: all `azure-standard` fields except `style`, plus `personal_voice_model`. - * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus - `personal_voice_model`; the voice name is derived from the avatar. - * `azure-realtime-native`: `voice` and `speed`. - `format` and `output_audio_timestamp_types` apply to every voice type. + * `avatar-voice-sync`: all `azure-standard` fields except `voice` and `style`, plus `personal_voice_model`; the + voice name is derived from the avatar. + * `azure-realtime-native`: `voice` and `speed`. `format` and `output_audio_timestamp_types` apply to every voice + type. :ivar format: The output audio format. Applies to every ``voice_type`` and defaults to 24 kHz PCM. @@ -32181,7 +32176,9 @@ class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstri :vartype subagent_config: ~azure.ai.projects.models.VoiceAgentSubagentConfig """ - sub_protocol: Optional[Literal["realtime"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + sub_protocol: Optional[Literal["realtime"]] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] + visibility=["read", "create", "update", "delete", "query"] + ) """Selects Realtime. May be omitted for legacy agents. Default value is \"realtime\".""" model_type: Optional[Union[str, "_models.VoiceModelType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -33059,7 +33056,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.sub_protocol: Literal["live"] = "live" + self.sub_protocol: Literal["live"] = "live" # pyright: ignore[reportIncompatibleVariableOverride] self.model_type: Literal["self_deployed"] = "self_deployed" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 5bd8f1ea1a92..d5a334362a82 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -7343,29 +7343,23 @@ def get_session_log_stream( Each SSE frame contains: * `event`: always `"log"` - * `data`: a plain-text log line (currently JSON-formatted, but the schema - is not contractual and may include additional keys or change format - over time — clients should treat it as an opaque string) + * `data`: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string) Example SSE frames: .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting - FoundryCBAgent server on port 8088"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application - startup complete."} + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully - connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since - last 60 seconds"} + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed. @@ -7407,7 +7401,7 @@ def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) From 4c805f36bcde5ace70d0e390e2dacca904c28954 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Fri, 23 Oct 2026 12:48:57 -0700 Subject: [PATCH 09/20] Part 3: Verify Foundry-owned Live protocol metadata Add offline coverage for all lifecycle snapshots, delegation ownership targets, native/null delegation preservation, pinned versions and public exports. Document the new unreleased metadata models without adding SDK-local model conversion patches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + .../tests/agents/test_live_protocol_models.py | 101 ++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index f4ac283d9f1a..403b19b24b5e 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features Added * Added generated GPT Live voice-agent configuration, delegation, and client/server event models. +* Added `VoiceAgentLiveSessionResource` and `VoiceAgentLiveDelegationItem` so Live lifecycle and delegation events preserve effective Foundry-managed ownership and resolved agent versions. * Added persisted Live conversation, item, and audio REST operations under `beta.voice_agents.live_conversations`. * Added image-generation model options and the `xhigh` and `max` quality values from the updated OpenAI TypeSpec dependency. diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py b/sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py new file mode 100644 index 000000000000..7b3b134513a1 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tests/agents/test_live_protocol_models.py @@ -0,0 +1,101 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Offline coverage for Foundry-owned GPT Live protocol metadata.""" + +from collections.abc import Mapping + +import pytest + +from azure.ai.projects import models + + +def _session(delegation): + return { + "id": "live-session-test", + "model": "synthetic-live-model", + "expires_at": 2000000000, + "status": "active", + "delegation": delegation, + } + + +@pytest.mark.parametrize( + "event_model,event_type", + [ + (models.LiveServerEventLiveSessionStarted, "session.started"), + (models.LiveServerEventLiveSessionUpdated, "session.updated"), + (models.LiveServerEventLiveSessionClosed, "session.closed"), + ], +) +def test_live_lifecycle_snapshots_report_the_pinned_foundry_delegation(event_model, event_type): + delegation = { + "type": "foundry_managed_agent", + "agent_name": "prompt-agent-test", + "agent_version": "7", + } + payload = { + "type": event_type, + "event_id": "event-test", + "session": _session(delegation), + } + if event_type == "session.started": + payload["conversation_id"] = "conversation-test" + elif event_type == "session.closed": + payload.update(reason="close_requested", usage={"seconds": 1.25}) + + event = event_model(payload) + + assert isinstance(event.session, models.VoiceAgentLiveSessionResource) + assert isinstance(event.session.delegation, Mapping) + assert event.session.delegation["type"] == "foundry_managed_agent" + assert event.session.delegation["agent_name"] == "prompt-agent-test" + assert event.session.delegation["agent_version"] == "7" + assert event.session.status == "active" + assert event.as_dict() == payload + + +@pytest.mark.parametrize("target", ["client", "responses", "foundry_managed_agent"]) +def test_live_delegation_created_reports_the_effective_owner_without_task_content(target): + payload = { + "type": "session.delegation.created", + "event_id": "event-test", + "offset_ms": 0, + "delegation": {"type": "delegation", "id": "delegation-test", "target": target}, + } + if target == "responses": + payload["delegation"]["response_id"] = "response-test" + + event = models.LiveServerEventLiveDelegationCreated(payload) + + assert isinstance(event.delegation, models.VoiceAgentLiveDelegationItem) + assert event.delegation.target == target + assert event.delegation.id == "delegation-test" + assert "input" not in event.delegation and "task" not in event.delegation + assert event.as_dict() == payload + + +@pytest.mark.parametrize( + "delegation", + [ + None, + {"type": "client"}, + {"type": "responses", "model": "synthetic-responses-model"}, + ], +) +def test_foundry_live_session_preserves_native_and_null_delegation_modes(delegation): + payload = _session(delegation) + session = models.VoiceAgentLiveSessionResource(payload) + + if delegation is None: + assert session.delegation is None + else: + assert isinstance(session.delegation, Mapping) + assert dict(session.delegation) == delegation + assert session.as_dict() == payload + + +def test_foundry_live_protocol_metadata_models_are_publicly_exported(): + assert "VoiceAgentLiveSessionResource" in models.__all__ + assert "VoiceAgentLiveDelegationItem" in models.__all__ From eb60461e4a3c9956059563d5bd76fe317f91aa4c Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Mon, 26 Oct 2026 13:02:42 -0700 Subject: [PATCH 10/20] Remove deprecated CloudComputerUsePreviewTool and CloudComputerUsePreviewToolboxTool; add VoiceAgentProfanityFilterMode; update apiHash and CrossLanguageVersion (#49708) --- sdk/ai/azure-ai-projects/api.md | 39 ++--- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure-ai-projects/apiview-properties.json | 5 +- .../azure/ai/projects/models/__init__.py | 6 +- .../azure/ai/projects/models/_enums.py | 15 +- .../azure/ai/projects/models/_models.py | 133 ++++++------------ sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 7 files changed, 67 insertions(+), 135 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 14c058cc8afb..18e386e97b2d 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -5825,35 +5825,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CloudComputerUsePreviewTool(Tool, discriminator='cloud_computer_use_preview'): - type: Literal[ToolType.CLOUD_COMPUTER_USE_PREVIEW] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.CloudComputerUsePreviewToolboxTool(ToolboxTool, discriminator='cloud_computer_use_preview'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.CLOUD_COMPUTER_USE_PREVIEW] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.ClusterInsightResult(_Model): clusters: list[InsightCluster] coordinates: Optional[dict[str, ChartCoordinate]] @@ -14541,7 +14512,6 @@ namespace azure.ai.projects.models BROWSER_AUTOMATION = "browser_automation" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" - CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" CODE_INTERPRETER = "code_interpreter" COMPUTER = "computer" COMPUTER_USE_PREVIEW = "computer_use_preview" @@ -14774,7 +14744,6 @@ namespace azure.ai.projects.models AZURE_AI_SEARCH = "azure_ai_search" BROWSER_AUTOMATION = "browser_automation" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" - CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" CODE_INTERPRETER = "code_interpreter" FABRIC_IQ_PREVIEW = "fabric_iq_preview" FILE_SEARCH = "file_search" @@ -15893,6 +15862,7 @@ namespace azure.ai.projects.models languages: Optional[list[str]] model: Union[str, VoiceAgentInputTranscriptionModel] phrase_list: Optional[list[str]] + profanity_filter: Optional[Union[str, VoiceAgentProfanityFilterMode]] prompt: Optional[str] @overload @@ -15906,6 +15876,7 @@ namespace azure.ai.projects.models languages: Optional[list[str]] = ..., model: Union[str, VoiceAgentInputTranscriptionModel], phrase_list: Optional[list[str]] = ..., + profanity_filter: Optional[Union[str, VoiceAgentProfanityFilterMode]] = ..., prompt: Optional[str] = ... ) -> None: ... @@ -16045,6 +16016,12 @@ namespace azure.ai.projects.models NEAR_FIELD = "near_field" + class azure.ai.projects.models.VoiceAgentProfanityFilterMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MASKED = "masked" + REMOVED = "removed" + UNFILTERED = "unfiltered" + + class azure.ai.projects.models.VoiceAgentRealtimeResponse(_Model): audio: Optional[VoiceResponseAudio] conversation_id: Optional[str] diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index b62a6af6a953..08209bca6036 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: c14dce33f27bced47cbb3c32e5e0ae9d6571207afde1a04fd2f300eb61e6da4f +apiHash: 6d0aa317b3cc2ff4eb3cb589c6e0ea5378fb532d70f6a6fc60470fac4f4bc66a packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.4 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index b53968854104..6f2e469326fe 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -141,8 +141,6 @@ "azure.ai.projects.models.ChatCompletionTool": "OpenAI.ChatCompletionTool", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", "azure.ai.projects.models.ChatSummaryMemoryItem": "Azure.AI.Projects.ChatSummaryMemoryItem", - "azure.ai.projects.models.CloudComputerUsePreviewTool": "Azure.AI.Projects.CloudComputerUsePreviewTool", - "azure.ai.projects.models.CloudComputerUsePreviewToolboxTool": "Azure.AI.Projects.CloudComputerUsePreviewToolboxTool", "azure.ai.projects.models.ClusterInsightResult": "Azure.AI.Projects.ClusterInsightResult", "azure.ai.projects.models.ClusterTokenUsage": "Azure.AI.Projects.ClusterTokenUsage", "azure.ai.projects.models.EvaluatorDefinition": "Azure.AI.Projects.EvaluatorDefinition", @@ -742,6 +740,7 @@ "azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", + "azure.ai.projects.models.VoiceAgentProfanityFilterMode": "Azure.AI.Projects.VoiceAgentProfanityFilterMode", "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", @@ -1001,5 +1000,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "3e7266b01602" + "CrossLanguageVersion": "5ac87b287e4b" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index fb94f312d5a4..f19206ba8b21 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -144,8 +144,6 @@ ChartCoordinate, ChatCompletionTool, ChatSummaryMemoryItem, - CloudComputerUsePreviewTool, - CloudComputerUsePreviewToolboxTool, ClusterInsightResult, ClusterTokenUsage, CodeBasedEvaluatorDefinition, @@ -848,6 +846,7 @@ VoiceAgentInputTranscriptionModel, VoiceAgentInterimResponseTrigger, VoiceAgentNoiseReductionType, + VoiceAgentProfanityFilterMode, VoiceAgentSessionIncludeOption, VoiceAgentSubagentAbortReason, VoiceAgentSystemToolName, @@ -996,8 +995,6 @@ "ChartCoordinate", "ChatCompletionTool", "ChatSummaryMemoryItem", - "CloudComputerUsePreviewTool", - "CloudComputerUsePreviewToolboxTool", "ClusterInsightResult", "ClusterTokenUsage", "CodeBasedEvaluatorDefinition", @@ -1697,6 +1694,7 @@ "VoiceAgentInputTranscriptionModel", "VoiceAgentInterimResponseTrigger", "VoiceAgentNoiseReductionType", + "VoiceAgentProfanityFilterMode", "VoiceAgentSessionIncludeOption", "VoiceAgentSubagentAbortReason", "VoiceAgentSystemToolName", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 1f23cc97f937..ecdf8821e733 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -2203,8 +2203,6 @@ class ToolboxToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """WEB_IQ_PREVIEW.""" BROWSER_AUTOMATION = "browser_automation" """BROWSER_AUTOMATION.""" - CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" - """CLOUD_COMPUTER_USE_PREVIEW.""" class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2335,8 +2333,6 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OPENAPI.""" MICROSOFT_COPILOT_TOOLSET_PREVIEW = "microsoft_copilot_toolset_preview" """MICROSOFT_COPILOT_TOOLSET_PREVIEW.""" - CLOUD_COMPUTER_USE_PREVIEW = "cloud_computer_use_preview" - """CLOUD_COMPUTER_USE_PREVIEW.""" class TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2514,6 +2510,17 @@ class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta) """Azure deep noise suppression.""" +class VoiceAgentProfanityFilterMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The supported input-transcript profanity filtering modes.""" + + MASKED = "masked" + """Masks recognized profanity in the transcript.""" + UNFILTERED = "unfiltered" + """Includes recognized profanity in the transcript, subject to mandatory service masking policies.""" + REMOVED = "removed" + """Removes recognized profanity from the transcript.""" + + class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Additional fields that a voice-agent session may include in service outputs.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 3af14c753494..4411de817909 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -176,12 +176,11 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2ATool, A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationTool, - BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CloudComputerUsePreviewTool, - CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, CustomToolParam, - MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, - GitHubCopilotToolsetPreview, ImageGenTool, LocalShellToolParam, MCPTool, - MemorySearchPreviewTool, MicrosoftCopilotToolsetPreview, NamespaceToolParam, OpenApiTool, - ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, + BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, + ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, + FileSearchTool, FunctionTool, GitHubCopilotToolsetPreview, ImageGenTool, LocalShellToolParam, + MCPTool, MemorySearchPreviewTool, MicrosoftCopilotToolsetPreview, NamespaceToolParam, + OpenApiTool, ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, WebIQPreviewTool, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", @@ -191,8 +190,8 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", "memory_search_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", "web_iq_preview", "github_copilot_toolset_preview", "a2a", "azure_ai_search", "azure_function", - "bing_grounding", "browser_automation", "capture_structured_outputs", "openapi", - "microsoft_copilot_toolset_preview", and "cloud_computer_use_preview". + "bing_grounding", "browser_automation", "capture_structured_outputs", "openapi", and + "microsoft_copilot_toolset_preview". :vartype type: str or ~azure.ai.projects.models.ToolType """ @@ -206,8 +205,8 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on \"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\", \"fabric_iq_preview\", \"toolbox_search_preview\", \"web_iq_preview\", \"github_copilot_toolset_preview\", \"a2a\", \"azure_ai_search\", \"azure_function\", - \"bing_grounding\", \"browser_automation\", \"capture_structured_outputs\", \"openapi\", - \"microsoft_copilot_toolset_preview\", and \"cloud_computer_use_preview\".""" + \"bing_grounding\", \"browser_automation\", \"capture_structured_outputs\", \"openapi\", and + \"microsoft_copilot_toolset_preview\".""" @overload def __init__( @@ -290,17 +289,15 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2AToolboxTool, A2APreviewToolboxTool, AzureAISearchToolboxTool, BrowserAutomationToolboxTool, - BrowserAutomationPreviewToolboxTool, CloudComputerUsePreviewToolboxTool, - CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, FileSearchToolboxTool, MCPToolboxTool, - OpenApiToolboxTool, ReminderPreviewToolboxTool, ShellToolboxTool, ToolSearchToolboxTool, - ToolboxSearchPreviewToolboxTool, WebIQPreviewToolboxTool, WebSearchToolboxTool, - WorkIQPreviewToolboxTool + BrowserAutomationPreviewToolboxTool, CodeInterpreterToolboxTool, FabricIQPreviewToolboxTool, + FileSearchToolboxTool, MCPToolboxTool, OpenApiToolboxTool, ReminderPreviewToolboxTool, + ShellToolboxTool, ToolSearchToolboxTool, ToolboxSearchPreviewToolboxTool, + WebIQPreviewToolboxTool, WebSearchToolboxTool, WorkIQPreviewToolboxTool :ivar type: The type of tool. Required. Known values are: "code_interpreter", "file_search", "web_search", "mcp", "azure_ai_search", "openapi", "a2a_preview", "browser_automation_preview", "reminder_preview", "work_iq_preview", "fabric_iq_preview", "toolbox_search", - "toolbox_search_preview", "a2a", "shell", "web_iq_preview", "browser_automation", and - "cloud_computer_use_preview". + "toolbox_search_preview", "a2a", "shell", "web_iq_preview", and "browser_automation". :vartype type: str or ~azure.ai.projects.models.ToolboxToolType :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -318,7 +315,7 @@ class ToolboxTool(_Model): # pylint: disable=docstring-keyword-should-match-key \"web_search\", \"mcp\", \"azure_ai_search\", \"openapi\", \"a2a_preview\", \"browser_automation_preview\", \"reminder_preview\", \"work_iq_preview\", \"fabric_iq_preview\", \"toolbox_search\", \"toolbox_search_preview\", \"a2a\", \"shell\", - \"web_iq_preview\", \"browser_automation\", and \"cloud_computer_use_preview\".""" + \"web_iq_preview\", and \"browser_automation\".""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional user-defined name for this tool or configuration.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -6035,6 +6032,9 @@ class BrowserAutomationPreviewTool( Tool, discriminator="browser_automation_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only """The input definition information for a Browser Automation Tool, as used to configure an Agent. + BrowserAutomationPreviewTool is deprecated. Please use BrowserAutomationTool instead. See + `https://aka.ms/bat/docs `_ for more information on Browser automation + tool. :ivar type: The object type, which is always 'browser_automation_preview'. Required. BROWSER_AUTOMATION_PREVIEW. @@ -6073,7 +6073,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class BrowserAutomationPreviewToolboxTool( ToolboxTool, discriminator="browser_automation_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A browser automation tool stored in a toolbox. + """A browser automation tool stored in a toolbox. BrowserAutomationPreviewToolboxTool is + deprecated. Please use BrowserAutomationToolboxTool instead. See `https://aka.ms/bat/docs + `_ for more information on Browser automation tool. :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str @@ -6497,76 +6499,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore -class CloudComputerUsePreviewTool(Tool, discriminator="cloud_computer_use_preview"): - """The input definition information for a cloud computer use tool, as used to configure an agent. - - :ivar type: The object type, which is always ``cloud_computer_use_preview``. Required. - CLOUD_COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.CLOUD_COMPUTER_USE_PREVIEW - """ - - type: Literal[ToolType.CLOUD_COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always ``cloud_computer_use_preview``. Required. - CLOUD_COMPUTER_USE_PREVIEW.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.CLOUD_COMPUTER_USE_PREVIEW # type: ignore - - -class CloudComputerUsePreviewToolboxTool( - ToolboxTool, discriminator="cloud_computer_use_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A cloud computer use tool stored in a toolbox. - - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. CLOUD_COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.CLOUD_COMPUTER_USE_PREVIEW - """ - - type: Literal[ToolboxToolType.CLOUD_COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CLOUD_COMPUTER_USE_PREVIEW.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolboxToolType.CLOUD_COMPUTER_USE_PREVIEW # type: ignore - - class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the cluster analysis. @@ -29328,8 +29260,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Asynchronous input-audio transcription configuration. Extends the OpenAI Realtime transcription - options with the Azure and MAI transcription models, custom speech models, and phrase hints. + """Settings for transcribing input audio, including the transcription model, Custom Speech + deployments, and phrase hints. :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 `_ (e.g. ``en``) format will improve @@ -29362,6 +29294,14 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword :vartype custom_speech: dict[str, str] :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. :vartype phrase_list: list[str] + :ivar profanity_filter: Controls how profanity is handled in input transcripts. Supported only + with managed Azure Speech (``azure-speech``), including Custom Speech. Set this property before + the session starts. If omitted, the transcription provider's default applies. You cannot change + the mode during a session. Filtering affects transcript events and the text sent to cascaded + models. It does not change input audio, voice activity detection, or assistant speech; + audio-native models still receive the original audio. Mandatory service masking policies apply + even when you select ``unfiltered``. Known values are: "masked", "unfiltered", and "removed". + :vartype profanity_filter: str or ~azure.ai.projects.models.VoiceAgentProfanityFilterMode """ language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -29399,6 +29339,16 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword """Optional customer custom speech deployment configuration, keyed by locale.""" phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional phrase hints that bias recognition toward domain terms.""" + profanity_filter: Optional[Union[str, "_models.VoiceAgentProfanityFilterMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls how profanity is handled in input transcripts. Supported only with managed Azure + Speech (``azure-speech``), including Custom Speech. Set this property before the session + starts. If omitted, the transcription provider's default applies. You cannot change the mode + during a session. Filtering affects transcript events and the text sent to cascaded models. It + does not change input audio, voice activity detection, or assistant speech; audio-native models + still receive the original audio. Mandatory service masking policies apply even when you select + ``unfiltered``. Known values are: \"masked\", \"unfiltered\", and \"removed\".""" @overload def __init__( @@ -29412,6 +29362,7 @@ def __init__( delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = None, custom_speech: Optional[dict[str, str]] = None, phrase_list: Optional[list[str]] = None, + profanity_filter: Optional[Union[str, "_models.VoiceAgentProfanityFilterMode"]] = None, ) -> None: ... @overload diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 67b8121475c6..3bed50a21393 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: b2cf9e36ed967aae8c43ed56973e1d1ac99255b3 +commit: 843aff73c2ace0d34082b485d72e0752e7849640 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 62e8273257451ac1e21c77c257c5bb65476d642f Mon Sep 17 00:00:00 2001 From: howieleung Date: Mon, 26 Oct 2026 13:34:07 -0700 Subject: [PATCH 11/20] Update CrossLanguageVersion and tsp-location.yaml commit reference --- sdk/ai/azure-ai-projects/apiview-properties.json | 2 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 6f2e469326fe..6479c4376586 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -1000,5 +1000,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "5ac87b287e4b" + "CrossLanguageVersion": "349d72a995bc" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 3bed50a21393..bbd83dce0b18 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 843aff73c2ace0d34082b485d72e0752e7849640 +commit: 887a9ea5d12f85f0a8aba04a7e41ac64c0feab1e repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From a85414bb8a99d8e84b6737621639797152bb0fe1 Mon Sep 17 00:00:00 2001 From: howieleung Date: Mon, 26 Oct 2026 14:17:58 -0700 Subject: [PATCH 12/20] Update openai-typespec to version 1.29.0; enhance model options and quality parameters in API documentation --- eng/emitter-package-lock.json | 8 +- eng/emitter-package.json | 2 +- sdk/ai/azure-ai-projects/api.md | 8 +- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure/ai/projects/models/_enums.py | 2 +- .../azure/ai/projects/models/_models.py | 163 +++++++++++------- 6 files changed, 112 insertions(+), 73 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 6dea4b09bc34..2ebd5e0eb399 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.63.10" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.28.0", + "@azure-tools/openai-typespec": "1.29.0", "@azure-tools/typespec-autorest": "~0.73.0", "@azure-tools/typespec-azure-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", @@ -31,9 +31,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.28.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.28.0.tgz", - "integrity": "sha1-rXCoTFopEeA3qKL8/P3Uim0ZuuA=", + "version": "1.29.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.29.0.tgz", + "integrity": "sha512-G4h4rgqB9NB3dcy8ayIHdLQ61D7r6G0WL/EQAKJ56lwPqtxjMXCWTskwjXleP3Dy7kDlpmh48SIaVLzmgidDPA==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 79c0abbe49bf..a1d14c4a3efd 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -22,6 +22,6 @@ "@azure-tools/typespec-client-generator-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", "@azure-tools/typespec-liftr-base": "0.13.0", - "@azure-tools/openai-typespec": "1.28.0" + "@azure-tools/openai-typespec": "1.29.0" } } diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 18e386e97b2d..781b36038866 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -8422,13 +8422,13 @@ namespace azure.ai.projects.models description: Optional[str] input_fidelity: Optional[Union[str, InputFidelity]] input_image_mask: Optional[ImageGenToolInputImageMask] - model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], str]] + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-5-sunburst"], Literal["gpt-image-5-sunburst-2026-09-08"], Literal["gpt-image-5-flare"], Literal["gpt-image-5-flare-2026-09-08"], str]] moderation: Optional[Literal["auto", "low"]] name: Optional[str] output_compression: Optional[int] output_format: Optional[Literal["png", "webp", "jpeg"]] partial_images: Optional[int] - quality: Optional[Literal["low", "medium", "high", "auto"]] + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] tool_configs: Optional[dict[str, ToolConfig]] type: Literal[ToolType.IMAGE_GENERATION] @@ -8442,13 +8442,13 @@ namespace azure.ai.projects.models description: Optional[str] = ..., input_fidelity: Optional[Union[str, InputFidelity]] = ..., input_image_mask: Optional[ImageGenToolInputImageMask] = ..., - model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], str]] = ..., + model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], Literal[gpt-image-5-sunburst], Literal[gpt-image-5-sunburst-2026-09-08], Literal[gpt-image-5-flare], Literal[gpt-image-5-flare-2026-09-08], str]] = ..., moderation: Optional[Literal[auto, low]] = ..., name: Optional[str] = ..., output_compression: Optional[int] = ..., output_format: Optional[Literal[png, webp, jpeg]] = ..., partial_images: Optional[int] = ..., - quality: Optional[Literal[low, medium, high, auto]] = ..., + quality: Optional[Literal[low, medium, high, xhigh, max, auto]] = ..., size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 08209bca6036..544bc121cff6 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: 6d0aa317b3cc2ff4eb3cb589c6e0ea5378fb532d70f6a6fc60470fac4f4bc66a +apiHash: ff4b937eebc8cf976c9ba4ea0368c1809c45d9981b27f9578847517ffabd1688 packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.4 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index ecdf8821e733..08638b66da49 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -1436,7 +1436,7 @@ class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): ``minimal``, ``low``, ``medium``, ``high``, ``xhigh``, and ``max``. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the `reasoning guide - `_ for model-specific support. + `_ for model-specific support. """ NONE = "none" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 4411de817909..809ccb00fd69 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -11700,9 +11700,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionParameters(_Model): """The parameters the functions accepts, described as a JSON Schema object. See the `guide - `_ for examples, and the `JSON Schema reference - `_ for documentation about the format. - Omitting ``parameters`` defines a function with an empty parameter list. + `_ for examples, and the `JSON + Schema reference `_ for documentation about + the format. Omitting ``parameters`` defines a function with an empty parameter list. """ @@ -12570,23 +12570,28 @@ class ImageGenTool( :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION :ivar model: Is one of the following types: Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], str - :vartype model: str or str or str or str or str or str - :ivar quality: The quality of the generated image. One of ``low``, ``medium``, ``high``, or - ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], - Literal["high"], Literal["auto"] - :vartype quality: str or str or str or str - :ivar size: The size of the generated images. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` strings, - for example ``1536x864``. Width and height must both be divisible by 16 and the requested - aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are experimental, and - the maximum supported resolution is ``3840x2160``. The requested size must also satisfy the - model's current pixel and edge limits. The standard sizes ``1024x1024``, ``1536x1024``, and - ``1024x1536`` are supported by the GPT image models; ``auto`` is supported for models that - allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, or - ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is - one of the following types: Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], - Literal["auto"], str + Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str + :vartype model: str or str or str or str or str or str or str or str or str or str + :ivar quality: The quality of the generated image. The GPT image models support ``low``, + ``medium``, and ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one + of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"], + Literal["max"], Literal["auto"] + :vartype quality: str or str or str or str or str or str + :ivar size: The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, + or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. + Is one of the following types: Literal["1024x1024"], Literal["1024x1536"], + Literal["1536x1024"], Literal["auto"], str :vartype size: str or str or str or str or str :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], @@ -12598,10 +12603,12 @@ class ImageGenTool( Literal["auto"] type or a Literal["low"] type. :vartype moderation: str or str :ivar background: Set the background of the generated image. One of ``transparent``, - ``opaque``, or ``auto``. Transparent backgrounds are available for supported GPT Image models. - For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, this support is in preview. When using - ``transparent``, set the output format to ``png`` or ``webp``. Default: ``auto``. Is one of the - following types: Literal["transparent"], Literal["opaque"], Literal["auto"] + ``opaque``, or ``auto``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent + backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the + output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: + Literal["transparent"], Literal["opaque"], Literal["auto"] :vartype background: str or str or str :ivar input_fidelity: Known values are: "high" and "low". :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity @@ -12633,30 +12640,40 @@ class ImageGenTool( Literal["gpt-image-1.5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str, ] ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], - Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], str""" - quality: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], + Literal[\"gpt-image-2.5-sunburst\"], Literal[\"gpt-image-2.5-sunburst-2026-09-08\"], + Literal[\"gpt-image-2.5-flare\"], Literal[\"gpt-image-2.5-flare-2026-09-08\"], str""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The quality of the generated image. One of ``low``, ``medium``, ``high``, or ``auto``. Default: - ``auto``. Is one of the following types: Literal[\"low\"], Literal[\"medium\"], - Literal[\"high\"], Literal[\"auto\"]""" + """The quality of the generated image. The GPT image models support ``low``, ``medium``, and + ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their + ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one of the + following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"], + Literal[\"max\"], Literal[\"auto\"]""" size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """The size of the generated images. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, arbitrary - resolutions are supported as ``WIDTHxHEIGHT`` strings, for example ``1536x864``. Width and - height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. - Resolutions above ``2560x1440`` are experimental, and the maximum supported resolution is - ``3840x2160``. The requested size must also satisfy the model's current pixel and edge limits. - The standard sizes ``1024x1024``, ``1536x1024``, and ``1024x1536`` are supported by the GPT - image models; ``auto`` is supported for models that allow automatic sizing. For ``dall-e-2``, - use one of ``256x256``, ``512x512``, or ``1024x1024``. For ``dall-e-3``, use one of - ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is one of the following types: - Literal[\"1024x1024\"], Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" + """The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, + or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. + Is one of the following types: Literal[\"1024x1024\"], Literal[\"1024x1536\"], + Literal[\"1536x1024\"], Literal[\"auto\"], str""" output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12673,10 +12690,12 @@ class ImageGenTool( visibility=["read", "create", "update", "delete", "query"] ) """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. - Transparent backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the - output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: - Literal[\"transparent\"], Literal[\"opaque\"], Literal[\"auto\"]""" + ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their ``2026-09-08`` + snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent backgrounds are + available for supported GPT Image models. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, + this support is in preview. When using ``transparent``, set the output format to ``png`` or + ``webp``. Default: ``auto``. Is one of the following types: Literal[\"transparent\"], + Literal[\"opaque\"], Literal[\"auto\"]""" input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12713,10 +12732,14 @@ def __init__( Literal["gpt-image-1.5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str, ] ] = None, - quality: Optional[Literal["low", "medium", "high", "auto"]] = None, + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None, size: Optional[ Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] ] = None, @@ -13731,7 +13754,10 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here `_. Currently supported + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -13798,7 +13824,10 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -13905,7 +13934,10 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here `_. Currently supported + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -13969,7 +14001,10 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -17301,8 +17336,9 @@ class RealtimeClientEventConversationItemCreate( """Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a "history" of the conversation and to add new items mid-stream, but has the current limitation that it cannot populate assistant - audio messages. If successful, the server will respond with a ``conversation.item.created`` - event, otherwise an ``error`` event will be sent. + audio messages. If successful, the server will emit a ``conversation.item.added`` event and, + when the item is finalized, a ``conversation.item.done`` event. Otherwise, an ``error`` event + will be sent. :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str @@ -17640,7 +17676,7 @@ class RealtimeClientEventOutputAudioBufferClear( to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be preceded by a ``response.cancel`` client event to stop the generation of the current response. `Learn more - `_. + `_. :ivar event_id: The unique ID of the client event used for error handling. :vartype event_id: str @@ -20287,7 +20323,7 @@ class RealtimeServerEventOutputAudioBufferCleared( VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current audio response. `Learn more - `_. + `_. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -25397,11 +25433,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An object specifying the format that the model must output. Configuring ``{ "type": "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied - JSON schema. Learn more in the `Structured Outputs guide `_. - The default format is ``{ "type": "text" }`` with no additional options. *Not recommended for - gpt-4o and newer models:** Setting to ``{ "type": "json_object" }`` enables the older JSON - mode, which ensures the message the model generates is valid JSON. Using ``json_schema`` is - preferred for models that support it. + JSON schema. Learn more in the `Structured Outputs guide + `_. The default format is ``{ + "type": "text" }`` with no additional options. *Not recommended for gpt-4o and newer models:** + Setting to ``{ "type": "json_object" }`` enables the older JSON mode, which ensures the message + the model generates is valid JSON. Using ``json_schema`` is preferred for models that support + it. You probably want to use the sub-classes and not this class directly. Known sub-classes are: TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText @@ -29275,10 +29312,11 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword ``gpt-transcribe`` and ``gpt-live-transcribe``. :vartype keywords: list[str] :ivar prompt: An optional text to guide the model's style or continue a previous audio segment. - For ``whisper-1``, the `prompt is a list of keywords `_. - For ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a - free text string, for example "expect words related to technology". Prompt is not supported - with ``gpt-realtime-whisper`` in GA Realtime sessions. + For ``whisper-1``, the `prompt is a list of keywords + `_. For + ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free + text string, for example "expect words related to technology". Prompt is not supported with + ``gpt-realtime-whisper`` in GA Realtime sessions. :vartype prompt: str :ivar delay: Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with @@ -29317,7 +29355,8 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword ``gpt-live-transcribe``.""" prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An optional text to guide the model's style or continue a previous audio segment. For - ``whisper-1``, the `prompt is a list of keywords `_. For + ``whisper-1``, the `prompt is a list of keywords + `_. For ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free text string, for example \"expect words related to technology\". Prompt is not supported with ``gpt-realtime-whisper`` in GA Realtime sessions.""" From e8fdf78f48e082d235585999daa305407e4ba53d Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Mon, 26 Oct 2026 14:49:04 -0700 Subject: [PATCH 13/20] Keep voice readback customization in the handwritten SDK PR Remove the non-emitted deserialization hook, its six behavior tests and its bug-fix entry from this emitted-only branch. The WebSocket/custom-code branch retains the same implementation and coverage; generated models and post-emitter typing corrections remain unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/ai/azure-ai-projects/CHANGELOG.md | 4 -- .../azure/ai/projects/models/_patch.py | 27 ------------- .../tests/agents/test_realtime_client.py | 40 ------------------- 3 files changed, 71 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 403b19b24b5e..805e291994fd 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -9,10 +9,6 @@ * Added persisted Live conversation, item, and audio REST operations under `beta.voice_agents.live_conversations`. * Added image-generation model options and the `xhigh` and `max` quality values from the updated OpenAI TypeSpec dependency. -### Bugs Fixed - -* Preserved concrete Live/Realtime voice-agent types on agent readback without inserting an omitted `sub_protocol`. - ## 2.9.0 (2026-10-16) ### Features Added diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py index e5f1e0b15405..ceec269ca869 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py @@ -17,7 +17,6 @@ ) from azure.core.utils import case_insensitive_dict from .._utils.polling import AIProjectsLROBasePolling, AsyncAIProjectsLROBasePolling -from . import _models from ._patch_evaluation_typeddicts import ( AzureAIAgentTargetParam, AzureAIBenchmarkPreviewEvalRunDataSource, @@ -806,31 +805,6 @@ def from_continuation_token( ] # Add all objects you want publicly available to users at this package level -def _deserialize_voice( - cls: type[_models.VoiceAgentBaseDefinition], data: Any, _exist_discriminators: list[str] -) -> _models.VoiceAgentBaseDefinition: - """Preserve typed voice readback without inserting an omitted sub_protocol. - - The pinned TypeSpec exposes this optional selector as OpenAPI-only metadata. - Remove this hook when regenerated models preserve the same types and omission. - - :param data: The wire representation of the voice agent definition. - :type data: Any - :param _exist_discriminators: Higher-level discriminators supplied by the model deserializer. - :type _exist_discriminators: list[str] - :return: The concrete voice definition, or the voice base model for a future selector. - :rtype: ~azure.ai.projects.models.VoiceAgentBaseDefinition - """ - if not isinstance(data, Mapping): - return cls(data) - protocol = data.get("sub_protocol", "realtime") - if protocol == "realtime": - return _models.VoiceAgentDefinition(data) - if protocol == "live": - return _models.VoiceAgentLiveDefinition(data) - return _models.VoiceAgentBaseDefinition(data) - - def patch_sdk(): """Do not remove from this file. @@ -838,4 +812,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - setattr(_models.VoiceAgentBaseDefinition, "_deserialize", classmethod(_deserialize_voice)) diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py index 5027e9e291c1..0f6f07e628c6 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_realtime_client.py @@ -40,46 +40,6 @@ _ENDPOINT = "https://my-account.services.ai.azure.com/api/projects/my-project" -@pytest.mark.parametrize( - "sub_protocol,expected_type", - [ - (None, models.VoiceAgentDefinition), - ("realtime", models.VoiceAgentDefinition), - ("live", models.VoiceAgentLiveDefinition), - ("future-protocol", models.VoiceAgentBaseDefinition), - ], -) -def test_voice_agent_readback_preserves_concrete_types_and_wire_omission(sub_protocol, expected_type): - definition = { - "kind": "voice", - "model": "deployment-test", - "model_type": "self_deployed" if sub_protocol == "live" else "managed", - } - if sub_protocol is not None: - definition["sub_protocol"] = sub_protocol - version = models.AgentVersionDetails({"name": "agent-test", "version": "1", "definition": definition}) - - assert type(version.definition) is expected_type - assert version.definition.as_dict() == definition - assert expected_type(definition).as_dict() == definition - if isinstance(version.definition, (models.VoiceAgentDefinition, models.VoiceAgentLiveDefinition)): - assert version.definition.model == "deployment-test" - - -@pytest.mark.parametrize( - "definition,expected_type", - [ - ({"kind": "prompt", "model": "deployment-test"}, models.PromptAgentDefinition), - ({"kind": "future-agent-kind", "custom": {"setting": True}}, models.AgentDefinition), - ], -) -def test_voice_readback_customization_does_not_change_other_agent_kinds(definition, expected_type): - version = models.AgentVersionDetails({"name": "agent-test", "version": "1", "definition": definition}) - - assert type(version.definition) is expected_type - assert version.definition.as_dict() == definition - - @pytest.mark.parametrize( "definition_type,expected_annotation,expected_payload", [ From a7899d5f2207550ecc4fb2145e5be84005e09bf1 Mon Sep 17 00:00:00 2001 From: howieleung Date: Wed, 28 Oct 2026 11:54:49 -0700 Subject: [PATCH 14/20] Add voice conversation engine and soundscape models; update API metadata and references --- sdk/ai/azure-ai-projects/api.md | 87 ++++++ sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure-ai-projects/apiview-properties.json | 7 +- .../azure/ai/projects/models/__init__.py | 10 + .../azure/ai/projects/models/_enums.py | 50 ++- .../azure/ai/projects/models/_models.py | 295 ++++++++++++++++-- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 7 files changed, 419 insertions(+), 34 deletions(-) diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 781b36038866..d134c71dec37 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -3516,6 +3516,7 @@ namespace azure.ai.projects.models MCP = "mcp" RESPONSES = "responses" VOICE = "voice" + VOICE_CONVERSATION_ENGINE = "voice_conversation_engine" class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): @@ -15717,6 +15718,7 @@ namespace azure.ai.projects.models output_modalities: Optional[list[Union[str, VoiceOutputModality]]] parallel_tool_calls: Optional[bool] rai_config: RaiConfig + soundscape: Optional[VoiceAgentSoundscapeConfig] store: Optional[bool] structured_inputs: Optional[dict[str, StructuredInputDefinition]] subagent_config: Optional[VoiceAgentSubagentConfig] @@ -15740,6 +15742,7 @@ namespace azure.ai.projects.models output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., parallel_tool_calls: Optional[bool] = ..., rai_config: Optional[RaiConfig] = ..., + soundscape: Optional[VoiceAgentSoundscapeConfig] = ..., store: Optional[bool] = ..., structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., subagent_config: Optional[VoiceAgentSubagentConfig] = ..., @@ -15886,6 +15889,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_SPEECH = "azure-speech" + AZURE_SPEECH_STREAMING = "azure-speech-streaming" GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" @@ -16012,6 +16016,8 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + AZURE_DEEP_NOISE_SUPPRESSION_HEADSET = "azure_deep_noise_suppression_headset" + AZURE_PERSONAL_NOISE_SUPPRESSION = "azure_personal_noise_suppression" FAR_FIELD = "far_field" NEAR_FIELD = "near_field" @@ -16658,6 +16664,87 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentSoundscapeConfig(_Model): + background: Optional[VoiceAgentSoundscapeTrackConfig] + closing: Optional[VoiceAgentSoundscapeTrackConfig] + opening: Optional[VoiceAgentSoundscapeTrackConfig] + transfer: Optional[VoiceAgentSoundscapeTrackConfig] + working: Optional[VoiceAgentSoundscapeWorkingTrackConfig] + + @overload + def __init__( + self, + *, + background: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + closing: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + opening: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + transfer: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + working: Optional[VoiceAgentSoundscapeWorkingTrackConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeSound(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUSY_STREET = "busy_street" + CALL_CENTER = "call_center" + DING1 = "ding1" + DING2 = "ding2" + OFFICE = "office" + PEOPLE_TALKING = "people_talking" + STREET_AND_METRO_STATION = "street_and_metro_station" + + + class azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig(_Model): + name: Union[str, VoiceAgentSoundscapeSound] + type: Literal["built_in"] + + @overload + def __init__( + self, + *, + name: Union[str, VoiceAgentSoundscapeSound] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig(_Model): + gain: Optional[float] + source: VoiceAgentSoundscapeSourceConfig + + @overload + def __init__( + self, + *, + gain: Optional[float] = ..., + source: VoiceAgentSoundscapeSourceConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig(_Model): + delay_ms: Optional[timedelta] + gain: Optional[float] + source: VoiceAgentSoundscapeSourceConfig + + @overload + def __init__( + self, + *, + delay_ms: Optional[timedelta] = ..., + gain: Optional[float] = ..., + source: VoiceAgentSoundscapeSourceConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): latency_threshold_ms: timedelta texts: Optional[list[str]] diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index 544bc121cff6..ad5516a35b18 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: ff4b937eebc8cf976c9ba4ea0368c1809c45d9981b27f9578847517ffabd1688 +apiHash: 0fa3ee4d720a5097b326a1a880488cb348281242682dccd36ab423263ba6a86b packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.4 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 6479c4376586..1eba81bf4087 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -638,6 +638,10 @@ "azure.ai.projects.models.VoiceAgentSessionAvatarConfig": "Azure.AI.Projects.VoiceAgentSessionAvatarConfig", "azure.ai.projects.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", "azure.ai.projects.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeConfig": "Azure.AI.Projects.VoiceAgentSoundscapeConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig": "Azure.AI.Projects.VoiceAgentSoundscapeSourceConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig": "Azure.AI.Projects.VoiceAgentSoundscapeTrackConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig": "Azure.AI.Projects.VoiceAgentSoundscapeWorkingTrackConfig", "azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", "azure.ai.projects.models.VoiceAgentSubagent": "Azure.AI.Projects.VoiceAgentSubagent", "azure.ai.projects.models.VoiceAgentSubagentConfig": "Azure.AI.Projects.VoiceAgentSubagentConfig", @@ -742,6 +746,7 @@ "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", "azure.ai.projects.models.VoiceAgentProfanityFilterMode": "Azure.AI.Projects.VoiceAgentProfanityFilterMode", "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", + "azure.ai.projects.models.VoiceAgentSoundscapeSound": "Azure.AI.Projects.VoiceAgentSoundscapeSound", "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", "azure.ai.projects.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", @@ -1000,5 +1005,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "349d72a995bc" + "CrossLanguageVersion": "6bc23fb38d44" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index f19206ba8b21..a170055a1338 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -649,6 +649,10 @@ VoiceAgentSessionAvatarConfig, VoiceAgentSessionResponseConfig, VoiceAgentSessionUpdateConfig, + VoiceAgentSoundscapeConfig, + VoiceAgentSoundscapeSourceConfig, + VoiceAgentSoundscapeTrackConfig, + VoiceAgentSoundscapeWorkingTrackConfig, VoiceAgentStaticInterimResponseConfig, VoiceAgentSubagent, VoiceAgentSubagentConfig, @@ -848,6 +852,7 @@ VoiceAgentNoiseReductionType, VoiceAgentProfanityFilterMode, VoiceAgentSessionIncludeOption, + VoiceAgentSoundscapeSound, VoiceAgentSubagentAbortReason, VoiceAgentSystemToolName, VoiceAgentToolResponseScheduling, @@ -1500,6 +1505,10 @@ "VoiceAgentSessionAvatarConfig", "VoiceAgentSessionResponseConfig", "VoiceAgentSessionUpdateConfig", + "VoiceAgentSoundscapeConfig", + "VoiceAgentSoundscapeSourceConfig", + "VoiceAgentSoundscapeTrackConfig", + "VoiceAgentSoundscapeWorkingTrackConfig", "VoiceAgentStaticInterimResponseConfig", "VoiceAgentSubagent", "VoiceAgentSubagentConfig", @@ -1696,6 +1705,7 @@ "VoiceAgentNoiseReductionType", "VoiceAgentProfanityFilterMode", "VoiceAgentSessionIncludeOption", + "VoiceAgentSoundscapeSound", "VoiceAgentSubagentAbortReason", "VoiceAgentSystemToolName", "VoiceAgentToolResponseScheduling", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 08638b66da49..0c681d00bac1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -146,6 +146,9 @@ class AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """VOICE.""" INVOCATIONS_WS = "invocations_ws" """WebSocket-based protocol for hosted voice and real-time streaming agents.""" + VOICE_CONVERSATION_ENGINE = "voice_conversation_engine" + """Text conversation protocol for a hosted agent used by Voice Live Bridge. Declare version + ``1.0.0``; audio transport remains outside this protocol.""" class AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2466,7 +2469,10 @@ class VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiv class VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The input-audio transcription model identifier. This is a model name, not a Foundry deployment name. Mirrors the transcription models supported by the managed voice backend, covering the - OpenAI Realtime transcription models plus the Azure and MAI models. Additional values may be + OpenAI Realtime transcription models plus the Azure and MAI models. ``azure-speech-streaming`` + is supported for cascaded text-model conversations only (not realtime speech-to-speech models), + requires a nonempty ``language`` such as ``en-US`` (comma-separated locales are supported), and + supports ``custom_speech``, ``phrase_list``, and ``profanity_filter``. Additional values may be added over time. """ @@ -2488,6 +2494,11 @@ class VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnum """MAI transcription.""" AZURE_SPEECH = "azure-speech" """Azure AI Speech to text.""" + AZURE_SPEECH_STREAMING = "azure-speech-streaming" + """Azure AI Speech streaming transcription for cascaded text-model conversations only. Requires a + nonempty ``language``, such as ``en-US``; comma-separated locales are supported. Supports + ``custom_speech``, ``phrase_list``, and ``profanity_filter``. Not supported with realtime + speech-to-speech models.""" class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2500,7 +2511,15 @@ class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumM class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input audio noise reduction mode.""" + """The input audio noise reduction mode. + + * `azure_deep_noise_suppression_headset`: Azure headset-optimized noise suppression for local voice activity + detection. Optimized for low-sample-rate audio, including 8 kHz telephony audio. Enhances detection audio without + changing the audio used for recognition. The mode is not restricted to headset devices. + * `azure_personal_noise_suppression`: Azure personalized noise suppression for local voice activity detection. + Starts with headset suppression and personalizes detection after automatic speaker enrollment. Recognition audio + is unchanged; headset suppression remains active when personalization is unavailable. + """ NEAR_FIELD = "near_field" """NEAR_FIELD.""" @@ -2508,6 +2527,14 @@ class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta) """FAR_FIELD.""" AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" """Azure deep noise suppression.""" + AZURE_DEEP_NOISE_SUPPRESSION_HEADSET = "azure_deep_noise_suppression_headset" + """Azure headset-optimized noise suppression for local voice activity detection. Optimized for + low-sample-rate audio, including 8 kHz telephony audio. Enhances detection audio without + changing the audio used for recognition. The mode is not restricted to headset devices.""" + AZURE_PERSONAL_NOISE_SUPPRESSION = "azure_personal_noise_suppression" + """Azure personalized noise suppression for local voice activity detection. Starts with headset + suppression and personalizes detection after automatic speaker enrollment. Recognition audio is + unchanged; headset suppression remains active when personalization is unavailable.""" class VoiceAgentProfanityFilterMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2532,6 +2559,25 @@ class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMet """FILE_SEARCH_CALL_RESULTS.""" +class VoiceAgentSoundscapeSound(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The packaged sounds accepted by a built-in soundscape source.""" + + OFFICE = "office" + """Quiet office ambience.""" + CALL_CENTER = "call_center" + """Busy call-center ambience.""" + BUSY_STREET = "busy_street" + """Busy street ambience.""" + PEOPLE_TALKING = "people_talking" + """Crowd conversation ambience.""" + STREET_AND_METRO_STATION = "street_and_metro_station" + """Street and metro-station ambience.""" + DING1 = "ding1" + """The first notification tone.""" + DING2 = "ding2" + """The second notification tone.""" + + class VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The reason a subagent consultation was aborted.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 809ccb00fd69..276f415b7c47 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -16864,7 +16864,7 @@ class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should """A record mapping for a single protocol and its version. :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", - "mcp", "invocations", "voice", and "invocations_ws". + "mcp", "invocations", "voice", "invocations_ws", and "voice_conversation_engine". :vartype protocol: str or ~azure.ai.projects.models.AgentEndpointProtocol :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. :vartype version: str @@ -16874,7 +16874,7 @@ class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should visibility=["read", "create", "update", "delete", "query"] ) """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", - \"invocations\", \"voice\", and \"invocations_ws\".""" + \"invocations\", \"voice\", \"invocations_ws\", and \"voice_conversation_engine\".""" version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The version string for the protocol, e.g. 'v0.1.1'. Required.""" @@ -28828,6 +28828,11 @@ class VoiceAgentDefinition( detection, noise reduction, and transcription. These values are session defaults; a client may override supported fields when connecting. :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig + :ivar soundscape: Optional background ambience and event cues, stored with the agent version + and separate from the audio configuration. Currently rendered only for telephony calls, not + browser WebRTC or direct voice WebSocket sessions. Omit this property to disable all auxiliary + audio. Persisted conversation recordings do not include the soundscape mix. + :vartype soundscape: ~azure.ai.projects.models.VoiceAgentSoundscapeConfig :ivar output_modalities: The output modalities the agent produces. Defaults to ``["audio"]``. ``animation`` and ``avatar`` are available when an avatar is configured. :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] @@ -28907,6 +28912,13 @@ class VoiceAgentDefinition( """The audio configuration, including input and output formats, voice, turn detection, noise reduction, and transcription. These values are session defaults; a client may override supported fields when connecting.""" + soundscape: Optional["_models.VoiceAgentSoundscapeConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional background ambience and event cues, stored with the agent version and separate from + the audio configuration. Currently rendered only for telephony calls, not browser WebRTC or + direct voice WebSocket sessions. Omit this property to disable all auxiliary audio. Persisted + conversation recordings do not include the soundscape mix.""" output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -28976,6 +28988,7 @@ def __init__( instructions: Optional[str] = None, greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, audio: Optional["_models.VoiceAgentAudioConfig"] = None, + soundscape: Optional["_models.VoiceAgentSoundscapeConfig"] = None, output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, @@ -29298,11 +29311,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Settings for transcribing input audio, including the transcription model, Custom Speech - deployments, and phrase hints. + deployments, and phrase hints. When ``model`` is ``azure-speech-streaming``, transcription is + supported for cascaded text-model conversations only (not realtime speech-to-speech models), + requires a nonempty ``language`` such as ``en-US`` (comma-separated locales are supported), and + supports ``custom_speech``, ``phrase_list``, and ``profanity_filter``. :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 `_ (e.g. ``en``) format will improve - accuracy and latency. + accuracy and latency. Optional for other transcription models; required and must be nonempty + when ``model`` is ``azure-speech-streaming`` (such as ``en-US``; comma-separated locales are + supported). :vartype language: str :ivar languages: Possible languages of the input audio, in `ISO-639-1 `_ format. Supported by @@ -29324,28 +29342,34 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword Literal["minimal"], Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] :vartype delay: str or str or str or str or str :ivar model: The transcription model identifier. Configure customer custom speech deployments - in ``custom_speech``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", + in ``custom_speech``. ``azure-speech-streaming`` is for cascaded text-model conversations only + (not realtime speech-to-speech models), requires a nonempty ``language`` such as ``en-US`` + (comma-separated locales are supported), and supports ``custom_speech``, ``phrase_list``, and + ``profanity_filter``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-transcribe-diarize", "gpt-transcribe", - "gpt-live-transcribe", "mai-transcribe", and "azure-speech". + "gpt-live-transcribe", "mai-transcribe", "azure-speech", and "azure-speech-streaming". :vartype model: str or ~azure.ai.projects.models.VoiceAgentInputTranscriptionModel :ivar custom_speech: Optional customer custom speech deployment configuration, keyed by locale. :vartype custom_speech: dict[str, str] :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. :vartype phrase_list: list[str] :ivar profanity_filter: Controls how profanity is handled in input transcripts. Supported only - with managed Azure Speech (``azure-speech``), including Custom Speech. Set this property before - the session starts. If omitted, the transcription provider's default applies. You cannot change - the mode during a session. Filtering affects transcript events and the text sent to cascaded - models. It does not change input audio, voice activity detection, or assistant speech; - audio-native models still receive the original audio. Mandatory service masking policies apply - even when you select ``unfiltered``. Known values are: "masked", "unfiltered", and "removed". + with managed Azure Speech (``azure-speech`` and ``azure-speech-streaming``), including Custom + Speech. Set this property before the session starts. If omitted, the transcription provider's + default applies. You cannot change the mode during a session. Filtering affects transcript + events and the text sent to cascaded models. It does not change input audio, voice activity + detection, or assistant speech; audio-native models still receive the original audio. Mandatory + service masking policies apply even when you select ``unfiltered``. Known values are: "masked", + "unfiltered", and "removed". :vartype profanity_filter: str or ~azure.ai.projects.models.VoiceAgentProfanityFilterMode """ language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The language of the input audio. Supplying the input language in `ISO-639-1 `_ (e.g. ``en``) format will improve - accuracy and latency.""" + accuracy and latency. Optional for other transcription models; required and must be nonempty + when ``model`` is ``azure-speech-streaming`` (such as ``en-US``; comma-separated locales are + supported).""" languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Possible languages of the input audio, in `ISO-639-1 `_ format. Supported by @@ -29371,9 +29395,13 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword visibility=["read", "create", "update", "delete", "query"] ) """The transcription model identifier. Configure customer custom speech deployments in - ``custom_speech``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", + ``custom_speech``. ``azure-speech-streaming`` is for cascaded text-model conversations only + (not realtime speech-to-speech models), requires a nonempty ``language`` such as ``en-US`` + (comma-separated locales are supported), and supports ``custom_speech``, ``phrase_list``, and + ``profanity_filter``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", \"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\", \"gpt-4o-transcribe-diarize\", - \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", and \"azure-speech\".""" + \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", \"azure-speech\", and + \"azure-speech-streaming\".""" custom_speech: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional customer custom speech deployment configuration, keyed by locale.""" phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -29382,12 +29410,13 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword visibility=["read", "create", "update", "delete", "query"] ) """Controls how profanity is handled in input transcripts. Supported only with managed Azure - Speech (``azure-speech``), including Custom Speech. Set this property before the session - starts. If omitted, the transcription provider's default applies. You cannot change the mode - during a session. Filtering affects transcript events and the text sent to cascaded models. It - does not change input audio, voice activity detection, or assistant speech; audio-native models - still receive the original audio. Mandatory service masking policies apply even when you select - ``unfiltered``. Known values are: \"masked\", \"unfiltered\", and \"removed\".""" + Speech (``azure-speech`` and ``azure-speech-streaming``), including Custom Speech. Set this + property before the session starts. If omitted, the transcription provider's default applies. + You cannot change the mode during a session. Filtering affects transcript events and the text + sent to cascaded models. It does not change input audio, voice activity detection, or assistant + speech; audio-native models still receive the original audio. Mandatory service masking + policies apply even when you select ``unfiltered``. Known values are: \"masked\", + \"unfiltered\", and \"removed\".""" @overload def __init__( @@ -29672,18 +29701,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAgentNoiseReduction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio noise reduction configuration. - - :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", - and "azure_deep_noise_suppression". + """Input audio noise reduction configuration. ``azure_deep_noise_suppression_headset`` and + ``azure_personal_noise_suppression`` are modes for local voice activity detection that enhance + detection audio without changing the audio used for recognition. + + :ivar type: The noise reduction mode. ``azure_deep_noise_suppression_headset`` provides + headset-optimized noise suppression for local voice activity detection, optimized for + low-sample-rate audio including 8 kHz telephony audio without changing recognition audio (not + restricted to headset devices). ``azure_personal_noise_suppression`` starts with headset + suppression for local voice activity detection and personalizes detection after automatic + speaker enrollment while keeping recognition audio unchanged and keeping headset suppression + active when personalization is unavailable. Required. Known values are: "near_field", + "far_field", "azure_deep_noise_suppression", "azure_deep_noise_suppression_headset", and + "azure_personal_noise_suppression". :vartype type: str or ~azure.ai.projects.models.VoiceAgentNoiseReductionType """ type: Union[str, "_models.VoiceAgentNoiseReductionType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and - \"azure_deep_noise_suppression\".""" + """The noise reduction mode. ``azure_deep_noise_suppression_headset`` provides headset-optimized + noise suppression for local voice activity detection, optimized for low-sample-rate audio + including 8 kHz telephony audio without changing recognition audio (not restricted to headset + devices). ``azure_personal_noise_suppression`` starts with headset suppression for local voice + activity detection and personalizes detection after automatic speaker enrollment while keeping + recognition audio unchanged and keeping headset suppression active when personalization is + unavailable. Required. Known values are: \"near_field\", \"far_field\", + \"azure_deep_noise_suppression\", \"azure_deep_noise_suppression_headset\", and + \"azure_personal_noise_suppression\".""" @overload def __init__( @@ -31363,6 +31408,194 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["realtime"] = "realtime" +class VoiceAgentSoundscapeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Agent-owned background ambience and event cues. Each omitted track is disabled. The service + rejects unknown fields; custom uploads, URLs, and inline audio are not supported. + + :ivar background: Continuous background ambience that continues during caller and agent speech. + :vartype background: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar working: A loop played while a non-call-control tool is pending and the agent is silent, + after the configured delay. + :vartype working: ~azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig + :ivar opening: An interruptible cue played before the first agent speech. + :vartype opening: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar transfer: A one-shot cue played after queued agent speech drains and before a committed + call transfer. + :vartype transfer: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar closing: A one-shot cue played after queued agent speech drains and before a committed + session end. + :vartype closing: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + """ + + background: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Continuous background ambience that continues during caller and agent speech.""" + working: Optional["_models.VoiceAgentSoundscapeWorkingTrackConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A loop played while a non-call-control tool is pending and the agent is silent, after the + configured delay.""" + opening: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An interruptible cue played before the first agent speech.""" + transfer: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A one-shot cue played after queued agent speech drains and before a committed call transfer.""" + closing: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A one-shot cue played after queued agent speech drains and before a committed session end.""" + + @overload + def __init__( + self, + *, + background: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + working: Optional["_models.VoiceAgentSoundscapeWorkingTrackConfig"] = None, + opening: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + transfer: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + closing: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentSoundscapeSourceConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A packaged sound selected from the service-managed catalogue. The service rejects unknown + source fields and discriminator values. + + :ivar type: The audio source type. Always ``built_in``. Required. Default value is "built_in". + :vartype type: str + :ivar name: The name of the packaged sound. Only the listed built-in sounds are accepted. + Required. Known values are: "office", "call_center", "busy_street", "people_talking", + "street_and_metro_station", "ding1", and "ding2". + :vartype name: str or ~azure.ai.projects.models.VoiceAgentSoundscapeSound + """ + + type: Literal["built_in"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The audio source type. Always ``built_in``. Required. Default value is \"built_in\".""" + name: Union[str, "_models.VoiceAgentSoundscapeSound"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the packaged sound. Only the listed built-in sounds are accepted. Required. Known + values are: \"office\", \"call_center\", \"busy_street\", \"people_talking\", + \"street_and_metro_station\", \"ding1\", and \"ding2\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.VoiceAgentSoundscapeSound"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["built_in"] = "built_in" + + +class VoiceAgentSoundscapeTrackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A soundscape track with its own audio source and playback volume. + + :ivar source: The required audio source for this track. Required. + :vartype source: ~azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig + :ivar gain: Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, + the service defaults to 1. A value of 0 mutes this track. + :vartype gain: float + """ + + source: "_models.VoiceAgentSoundscapeSourceConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The required audio source for this track. Required.""" + gain: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, the service + defaults to 1. A value of 0 mutes this track.""" + + @overload + def __init__( + self, + *, + source: "_models.VoiceAgentSoundscapeSourceConfig", + gain: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentSoundscapeWorkingTrackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A working-loop track with a delay measured from the first pending non-call-control tool. + + :ivar source: The required audio source for this track. Required. + :vartype source: ~azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig + :ivar gain: Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, + the service defaults to 1. A value of 0 mutes this track. + :vartype gain: float + :ivar delay_ms: The delay in milliseconds before working audio starts, from 0 to 10000. If + omitted, the service defaults to 1000 milliseconds. This delays only working audio, not tool + execution, and is valid only on the working track. + :vartype delay_ms: ~datetime.timedelta + """ + + source: "_models.VoiceAgentSoundscapeSourceConfig" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The required audio source for this track. Required.""" + gain: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, the service + defaults to 1. A value of 0 mutes this track.""" + delay_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The delay in milliseconds before working audio starts, from 0 to 10000. If omitted, the service + defaults to 1000 milliseconds. This delays only working audio, not tool execution, and is valid + only on the working track.""" + + @overload + def __init__( + self, + *, + source: "_models.VoiceAgentSoundscapeSourceConfig", + gain: Optional[float] = None, + delay_ms: Optional[datetime.timedelta] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class VoiceAgentStaticInterimResponseConfig( VoiceAgentInterimResponseConfig, discriminator="static_interim_response" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -32064,8 +32297,12 @@ class VoiceHostedAgentConversationEngine( VoiceConversationEngine, discriminator="hosted_agent" ): # pylint: disable=docstring-keyword-should-match-keyword-only """A closed reference to the hosted text agent that owns conversation handling for a voice agent. - The hosted agent is resolved within the same project and must support the ``invocations_ws`` - protocol, Voice Live compatibility, and Bridge Protocol 1.0. + The hosted agent is resolved within the same project and must declare + ``voice_conversation_engine`` version ``1.0.0``. Voice Live connects through the dedicated + voice-conversation-engine endpoint using the existing Bridge Protocol 1.0 wire semantics; the + Bridge message version is independent of the container protocol version and the Hosted Agents + API version ``v1``. Declaring ``invocations_ws`` is optional and does not substitute for + ``voice_conversation_engine``. :ivar type: Selects a hosted Foundry agent as the conversation engine. Required. Default value is "hosted_agent". diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index bbd83dce0b18..09fc18e7bff5 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 887a9ea5d12f85f0a8aba04a7e41ac64c0feab1e +commit: bdf26751385b0afc96e53feddc0d7099694bcb91 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 1ba02019b25c2e719046ddc5039e25223a60f16a Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Wed, 28 Oct 2026 21:45:13 -0700 Subject: [PATCH 15/20] Regenerate GPT Live APIs from TypeSpec e5234c2 Align OpenAI TypeSpec and its lockfile to 1.32.0. Regenerate SDK models and paired API artifacts, retaining existing post-emitter fixes. VoiceAgents validation passes: wheel/sdist, 112 offline model/transport tests, SDK Mypy/Pylint/Black and SDK/VoiceAgents Pyright. Full-sample Pyright retains 30 shared-tool naming errors outside VoiceAgents, left unchanged per review scope. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/emitter-package-lock.json | 8 +- eng/emitter-package.json | 2 +- sdk/ai/azure-ai-projects/CHANGELOG.md | 7 +- sdk/ai/azure-ai-projects/api.md | 2192 +- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure-ai-projects/apiview-properties.json | 116 +- .../azure/ai/projects/_unions.py | 2 + .../azure/ai/projects/models/__init__.py | 224 +- .../azure/ai/projects/models/_enums.py | 135 +- .../azure/ai/projects/models/_models.py | 22391 +++++++++------- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 11 files changed, 14868 insertions(+), 10213 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 2ebd5e0eb399..f6c58377b724 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.63.10" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.29.0", + "@azure-tools/openai-typespec": "1.32.0", "@azure-tools/typespec-autorest": "~0.73.0", "@azure-tools/typespec-azure-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", @@ -31,9 +31,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.29.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.29.0.tgz", - "integrity": "sha512-G4h4rgqB9NB3dcy8ayIHdLQ61D7r6G0WL/EQAKJ56lwPqtxjMXCWTskwjXleP3Dy7kDlpmh48SIaVLzmgidDPA==", + "version": "1.32.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.32.0.tgz", + "integrity": "sha512-jLREAF3X/WLnOJdBbsP3gldPBCumhdFwpUc+kmo/l3MGxd/7CugsojaWOnYxqhaQ0LMfwIAzR/GYa4rBx/foTQ==", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index a1d14c4a3efd..fa583234642a 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -22,6 +22,6 @@ "@azure-tools/typespec-client-generator-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", "@azure-tools/typespec-liftr-base": "0.13.0", - "@azure-tools/openai-typespec": "1.29.0" + "@azure-tools/openai-typespec": "1.32.0" } } diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 805e291994fd..bbcd65f4a941 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -4,11 +4,16 @@ ### Features Added -* Added generated GPT Live voice-agent configuration, delegation, and client/server event models. +* Added generated GPT Live configuration and event models from OpenAI TypeSpec 1.32, including Decisions, expanded Responses tools, and audio fixtures. * Added `VoiceAgentLiveSessionResource` and `VoiceAgentLiveDelegationItem` so Live lifecycle and delegation events preserve effective Foundry-managed ownership and resolved agent versions. * Added persisted Live conversation, item, and audio REST operations under `beta.voice_agents.live_conversations`. * Added image-generation model options and the `xhigh` and `max` quality values from the updated OpenAI TypeSpec dependency. +### Breaking Changes + +* Renamed preview Live transport event models from `LiveTransportAnswered`, `LiveTransportFailed`, and `LiveTransportRinging` to `LiveServerEventLiveTransportAnswered`, `LiveServerEventLiveTransportFailed`, and `LiveServerEventLiveTransportRinging`. Their wire event types are unchanged. +* OpenAI TypeSpec 1.32 generates `Tool`-prefixed names for several existing tool classes. Use `ToolMcpTool` and `ToolCustomToolParam` where a `Tool` subtype is required; `MCPTool` and `CustomToolParam` are now standalone models. + ## 2.9.0 (2026-10-16) ### Features Added diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 5ae003485093..d66b30081f2a 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -3516,6 +3516,7 @@ namespace azure.ai.projects.models MCP = "mcp" RESPONSES = "responses" VOICE = "voice" + VOICE_CONVERSATION_ENGINE = "voice_conversation_engine" class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): @@ -4952,6 +4953,101 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.AnswerResource(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceChoice(AnswerResource, discriminator='choice'): + choice: ChoiceValueResource + confidence: float + name: str + probabilities: list[ChoiceProbabilityResource] + type: Literal[AnswerResourceType.CHOICE] + + @overload + def __init__( + self, + *, + choice: ChoiceValueResource, + confidence: float, + name: str, + probabilities: list[ChoiceProbabilityResource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourcePredicate(AnswerResource, discriminator='predicate'): + name: str + probability: float + type: Literal[AnswerResourceType.PREDICATE] + + @overload + def __init__( + self, + *, + name: str, + probability: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceRefusal(AnswerResource, discriminator='refusal'): + name: str + type: Literal[AnswerResourceType.REFUSAL] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceScore(AnswerResource, discriminator='score'): + confidence: float + name: str + probabilities: list[ScoreProbabilityResource] + score: float + type: Literal[AnswerResourceType.SCORE] + + @overload + def __init__( + self, + *, + confidence: float, + name: str, + probabilities: list[ScoreProbabilityResource], + score: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AnswerResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHOICE = "choice" + PREDICATE = "predicate" + REFUSAL = "refusal" + SCORE = "score" + + class azure.ai.projects.models.ApiError(_Model): additional_info: Optional[dict[str, Any]] code: str @@ -5005,21 +5101,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ApplyPatchToolParam(Tool, discriminator='apply_patch'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - type: Literal[ToolType.APPLY_PATCH] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.ApproximateLocation(_Model): city: Optional[str] country: Optional[str] @@ -5825,6 +5906,38 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ChoiceOptionParam(_Model): + description: Optional[str] + value: ChoiceValueParam + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + value: ChoiceValueParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ChoiceProbabilityResource(_Model): + probability: float + value: ChoiceValueResource + + @overload + def __init__( + self, + *, + probability: float, + value: ChoiceValueResource + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.ClusterInsightResult(_Model): clusters: list[InsightCluster] coordinates: Optional[dict[str, ChartCoordinate]] @@ -5912,29 +6025,6 @@ namespace azure.ai.projects.models REMOTE_BUILD = "remote_build" - class azure.ai.projects.models.CodeInterpreterTool(Tool, discriminator='code_interpreter'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - container: Optional[Union[str, AutoCodeInterpreterToolParam]] - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.CODE_INTERPRETER] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.CodeInterpreterToolboxTool(ToolboxTool, discriminator='code_interpreter'): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] container: Optional[Union[str, AutoCodeInterpreterToolParam]] @@ -5977,14 +6067,14 @@ namespace azure.ai.projects.models class azure.ai.projects.models.CompoundFilter(_Model): - filters: list[Union[ComparisonFilter, Any]] + filters: list[Union[ComparisonFilter, CompoundFilter]] type: Literal["and", "or"] @overload def __init__( self, *, - filters: list[Union[ComparisonFilter, Any]], + filters: list[Union[ComparisonFilter, CompoundFilter]], type: Literal["and", "or"] ) -> None: ... @@ -6000,35 +6090,6 @@ namespace azure.ai.projects.models WINDOWS = "windows" - class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): - type: Literal[ToolType.COMPUTER] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.ComputerUsePreviewTool(Tool, discriminator='computer_use_preview'): - display_height: int - display_width: int - environment: Union[str, ComputerEnvironment] - type: Literal[ToolType.COMPUTER_USE_PREVIEW] - - @overload - def __init__( - self, - *, - display_height: int, - display_width: int, - environment: Union[str, ComputerEnvironment] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.Connection(_Model): credentials: BaseCredentials id: str @@ -6452,14 +6513,14 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CustomToolParam(Tool, discriminator='custom'): + class azure.ai.projects.models.CustomToolParam(_Model): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] async_property: Optional[bool] defer_loading: Optional[bool] description: Optional[str] format: Optional[CustomToolParamFormat] name: str - type: Literal[ToolType.CUSTOM] + type: Literal["custom"] @overload def __init__( @@ -6798,6 +6859,24 @@ namespace azure.ai.projects.models WEDNESDAY = "Wednesday" + class azure.ai.projects.models.DecisionResponse(_Model): + answers: list[AnswerResource] + model: str + usage: ResponseUsageResource + + @overload + def __init__( + self, + *, + answers: list[AnswerResource], + model: str, + usage: ResponseUsageResource + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.Delegation(_Model): type: str @@ -7910,33 +7989,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.FileSearchTool(Tool, discriminator='file_search'): - description: Optional[str] - filters: Optional[Filters] - max_num_results: Optional[int] - name: Optional[str] - ranking_options: Optional[RankingOptions] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.FILE_SEARCH] - vector_store_ids: list[str] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - filters: Optional[Filters] = ..., - max_num_results: Optional[int] = ..., - name: Optional[str] = ..., - ranking_options: Optional[RankingOptions] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - vector_store_ids: list[str] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.FileSearchToolboxTool(ToolboxTool, discriminator='file_search'): description: str filters: Optional[Filters] @@ -8075,29 +8127,6 @@ namespace azure.ai.projects.models class azure.ai.projects.models.FunctionParameters(_Model): - class azure.ai.projects.models.FunctionShellToolParam(Tool, discriminator='shell'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - description: Optional[str] - environment: Optional[FunctionShellToolParamEnvironment] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.SHELL] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - description: Optional[str] = ..., - environment: Optional[FunctionShellToolParamEnvironment] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): type: str @@ -8148,35 +8177,6 @@ namespace azure.ai.projects.models LOCAL = "local" - class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] - async_property: Optional[bool] - defer_loading: Optional[bool] - description: Optional[str] - name: str - output_schema: Optional[dict[str, Any]] - parameters: dict[str, Any] - strict: bool - type: Literal[ToolType.FUNCTION] - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., - async_property: Optional[bool] = ..., - defer_loading: Optional[bool] = ..., - description: Optional[str] = ..., - name: str, - output_schema: Optional[dict[str, Any]] = ..., - parameters: dict[str, Any], - strict: bool - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.FunctionToolParam(_Model): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] async_property: Optional[bool] @@ -8435,47 +8435,6 @@ namespace azure.ai.projects.models GENERATE = "generate" - class azure.ai.projects.models.ImageGenTool(Tool, discriminator='image_generation'): - action: Optional[Union[str, ImageGenAction]] - background: Optional[Literal["transparent", "opaque", "auto"]] - description: Optional[str] - input_fidelity: Optional[Union[str, InputFidelity]] - input_image_mask: Optional[ImageGenToolInputImageMask] - model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-5-sunburst"], Literal["gpt-image-5-sunburst-2026-09-08"], Literal["gpt-image-5-flare"], Literal["gpt-image-5-flare-2026-09-08"], str]] - moderation: Optional[Literal["auto", "low"]] - name: Optional[str] - output_compression: Optional[int] - output_format: Optional[Literal["png", "webp", "jpeg"]] - partial_images: Optional[int] - quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] - size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.IMAGE_GENERATION] - - @overload - def __init__( - self, - *, - action: Optional[Union[str, ImageGenAction]] = ..., - background: Optional[Literal[transparent, opaque, auto]] = ..., - description: Optional[str] = ..., - input_fidelity: Optional[Union[str, InputFidelity]] = ..., - input_image_mask: Optional[ImageGenToolInputImageMask] = ..., - model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], Literal[gpt-image-5-sunburst], Literal[gpt-image-5-sunburst-2026-09-08], Literal[gpt-image-5-flare], Literal[gpt-image-5-flare-2026-09-08], str]] = ..., - moderation: Optional[Literal[auto, low]] = ..., - name: Optional[str] = ..., - output_compression: Optional[int] = ..., - output_format: Optional[Literal[png, webp, jpeg]] = ..., - partial_images: Optional[int] = ..., - quality: Optional[Literal[low, medium, high, xhigh, max, auto]] = ..., - size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.ImageGenToolInputImageMask(_Model): file_id: Optional[str] image_url: Optional[str] @@ -8559,6 +8518,22 @@ namespace azure.ai.projects.models LOW = "low" + class azure.ai.projects.models.InputTokensDetailsResource(_Model): + cache_write_tokens: int + cached_tokens: int + + @overload + def __init__( + self, + *, + cache_write_tokens: int, + cached_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.Insight(_Model): display_name: str insight_id: str @@ -8832,6 +8807,33 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveAllowedToolsChoiceParam(_Model): + mode: Optional[Union[str, LiveToolChoiceValueEnum]] + tools: list[Union[LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam]] + type: Literal["allowed_tools"] + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, LiveToolChoiceValueEnum]] = ..., + tools: list[Union[LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveApplyPatchToolInputParam(_Model): + type: Literal["apply_patch"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + class azure.ai.projects.models.LiveAudioFormat(_Model): type: str @@ -8909,6 +8911,55 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveClientEventLiveDecisionCreateParam(LiveClientEvent, discriminator='decision.create'): + event_id: str + type: Literal[LiveClientEventType.DECISION_CREATE] + + @overload + def __init__( + self, + *, + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveDecisionItemCreateParam(LiveClientEvent, discriminator='decision.item.create'): + event_id: Optional[str] + item: LiveDecisionInputItemParam + type: Literal[LiveClientEventType.DECISION_ITEM_CREATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: LiveDecisionInputItemParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveClientEventLiveDecisionItemDeleteParam(LiveClientEvent, discriminator='decision.item.delete'): + event_id: Optional[str] + item_id: str + type: Literal[LiveClientEventType.DECISION_ITEM_DELETE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveClientEventLiveInputAudioAppendEvent(LiveClientEvent, discriminator='session.input_audio.append'): audio: str event_id: Optional[str] @@ -8975,6 +9026,23 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveClientEventLiveOutputAudioFixturePlayParam(LiveClientEvent, discriminator='session.output_audio.fixture.play'): + audio: str + event_id: Optional[str] + type: Literal[LiveClientEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY] + + @overload + def __init__( + self, + *, + audio: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveClientEventLiveResponseCreateParam(LiveClientEvent, discriminator='response.create'): event_id: Optional[str] type: Literal[LiveClientEventType.RESPONSE_CREATE] @@ -9059,6 +9127,9 @@ namespace azure.ai.projects.models class azure.ai.projects.models.LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECISION_CREATE = "decision.create" + DECISION_ITEM_CREATE = "decision.item.create" + DECISION_ITEM_DELETE = "decision.item.delete" RESPONSE_CREATE = "response.create" RESPONSE_ITEM_CREATE = "response.item.create" SESSION_CLOSE = "session.close" @@ -9067,11 +9138,64 @@ namespace azure.ai.projects.models SESSION_INPUT_AUDIO_MUTE = "session.input_audio.mute" SESSION_INPUT_AUDIO_UNMUTE = "session.input_audio.unmute" SESSION_INSTRUCTIONS_APPEND = "session.instructions.append" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAY = "session.output_audio.fixture.play" SESSION_START = "session.start" SESSION_THINKING_APPEND = "session.thinking.append" SESSION_UPDATE = "session.update" + class azure.ai.projects.models.LiveCodeInterpreterToolInputParam(_Model): + type: Literal["code_interpreter"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveComputerToolInputParam(_Model): + type: Literal["computer"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ENUM_16_G = "16g" + ENUM_1_G = "1g" + ENUM_4_G = "4g" + ENUM_64_G = "64g" + + + class azure.ai.projects.models.LiveContainerNetworkPolicyDisabledParam(_Model): + type: Literal["disabled"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveContainerReferenceParam(_Model): + container_id: str + type: Literal["container_reference"] + + @overload + def __init__( + self, + *, + container_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveContextWindowUsage(_Model): usage_ratio: float @@ -9086,6 +9210,16 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveCustomToolInputParam(_Model): + type: Literal["custom"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + class azure.ai.projects.models.LiveCustomVoiceParam(_Model): id: str @@ -9116,107 +9250,98 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveDelegationReasoningInputParam(_Model): - effort: Optional[Union[str, LiveReasoningEffort]] - summary: Optional[Union[str, LiveReasoningSummary]] + class azure.ai.projects.models.LiveDecisionCompleted(_Model): + decision: DecisionResponse + type: Literal["completed"] @overload def __init__( self, *, - effort: Optional[Union[str, LiveReasoningEffort]] = ..., - summary: Optional[Union[str, LiveReasoningSummary]] = ... + decision: DecisionResponse ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveDelegationTextInputParam(_Model): - verbosity: Optional[Union[str, LiveTextVerbosity]] + class azure.ai.projects.models.LiveDecisionInputImageParam(_Model): + detail: Optional[Union[str, LiveDetailEnum]] + image_url: str + type: Literal["input_image"] @overload def __init__( self, *, - verbosity: Optional[Union[str, LiveTextVerbosity]] = ... + detail: Optional[Union[str, LiveDetailEnum]] = ..., + image_url: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveFunctionToolChoiceParam(_Model): - name: str - type: Literal["function"] + class azure.ai.projects.models.LiveDecisionInputItemParam(_Model): + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]] + id: Optional[str] + role: Literal["user"] + type: Optional[Literal["message"]] @overload def __init__( self, *, - name: str + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]], + id: Optional[str] = ..., + type: Optional[Literal[message]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveFunctionToolInputParam(_Model): - description: Optional[str] - name: str - parameters: Optional[dict[str, Any]] - strict: Optional[bool] - type: Literal["function"] + class azure.ai.projects.models.LiveDecisionInputTextParam(_Model): + text: str + type: Literal["input_text"] @overload def __init__( self, *, - description: Optional[str] = ..., - name: str, - parameters: Optional[dict[str, Any]] = ..., - strict: Optional[bool] = ... + text: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialAssistantMessageItemParam(LiveInitialItem, discriminator='assistant'): - content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]] - id: Optional[str] - role: Literal[LiveInitialItemType.ASSISTANT] - status: Optional[Union[str, LiveInitialMessageStatus]] - type: Optional[Literal["message"]] + class azure.ai.projects.models.LiveDecisionQuestionsInputParam_2(_Model): + questions: list[QuestionParam] @overload def __init__( self, *, - content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]], - id: Optional[str] = ..., - status: Optional[Union[str, LiveInitialMessageStatus]] = ..., - type: Optional[Literal[message]] = ... + questions: list[QuestionParam] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialDeveloperMessageItemParam(LiveInitialItem, discriminator='developer'): - content: list[LiveInitialInputTextContentPartParam] - id: Optional[str] - role: Literal[LiveInitialItemType.DEVELOPER] - status: Optional[Union[str, LiveInitialMessageStatus]] + class azure.ai.projects.models.LiveDecisionStoredInputItemParam(_Model): + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]] + id: str + role: Literal["user"] type: Optional[Literal["message"]] @overload def __init__( self, *, - content: list[LiveInitialInputTextContentPartParam], - id: Optional[str] = ..., - status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + content: Union[str, list[Union[LiveDecisionInputTextParam, LiveDecisionInputImageParam]]], + id: str, type: Optional[Literal[message]] = ... ) -> None: ... @@ -9224,101 +9349,366 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialInputTextContentPartParam(_Model): - text: str - type: Optional[Literal["input_text"]] + class azure.ai.projects.models.LiveDecisionTriggerInputParam_2(_Model): + decisions: LiveDecisionQuestionsInputParam_2 + event_type: Literal["delta", "delta"] + type: Literal["decisions"] @overload def __init__( self, *, - text: str, - type: Optional[Literal[input_text]] = ... + decisions: LiveDecisionQuestionsInputParam_2, + event_type: Literal["delta", "delta"] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialItem(_Model): - role: str + class azure.ai.projects.models.LiveDecisionsDelegationParam_2(_Model): + decisions: LiveDecisionsSettingsInputParam_2 + type: Literal["decisions"] @overload def __init__( self, *, - role: str + decisions: LiveDecisionsSettingsInputParam_2 ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT = "assistant" - DEVELOPER = "developer" - USER = "user" - - - class azure.ai.projects.models.LiveInitialMessageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLETED = "completed" - INCOMPLETE = "incomplete" - - - class azure.ai.projects.models.LiveInitialOutputTextContentPartParam(_Model): - text: str - type: Literal["output_text"] + class azure.ai.projects.models.LiveDecisionsDelegationUpdateParam(_Model): + decisions: Optional[LiveDecisionsSettingsUpdateParam] + type: Literal["decisions"] @overload def __init__( self, *, - text: str + decisions: Optional[LiveDecisionsSettingsUpdateParam] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialSessionAudioOutputParam(_Model): - voice: Optional[Union[str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], Literal["bossa"], Literal["cedar"], Literal["cinder"], Literal["coral"], Literal["delta"], Literal["echo"], Literal["gleam"], Literal["marin"], Literal["meridian"], Literal["quartz"], Literal["ripple"], Literal["sage"], Literal["shimmer"], Literal["stone"], Literal["tempo"], Literal["verse"], Literal["vesper"], Literal["willow"], LiveCustomVoiceParam]] + class azure.ai.projects.models.LiveDecisionsSettingsInputParam_2(_Model): + model: str + questions: list[QuestionParam] @overload def __init__( self, *, - voice: Optional[Union[str, Literal[alloy], Literal[ash], Literal[ballad], Literal[beacon], Literal[bossa], Literal[cedar], Literal[cinder], Literal[coral], Literal[delta], Literal[echo], Literal[gleam], Literal[marin], Literal[meridian], Literal[quartz], Literal[ripple], Literal[sage], Literal[shimmer], Literal[stone], Literal[tempo], Literal[verse], Literal[vesper], Literal[willow], LiveCustomVoiceParam]] = ... + model: str, + questions: list[QuestionParam] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialSessionAudioParam(_Model): - format: Optional[LiveAudioFormat] - output: Optional[LiveInitialSessionAudioOutputParam] + class azure.ai.projects.models.LiveDecisionsSettingsUpdateParam(_Model): + model: Optional[str] + questions: Optional[list[QuestionParam]] @overload def __init__( self, *, - format: Optional[LiveAudioFormat] = ..., - output: Optional[LiveInitialSessionAudioOutputParam] = ... + model: Optional[str] = ..., + questions: Optional[list[QuestionParam]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveInitialTextContentPartParam(_Model): - text: str - type: Optional[Literal["text"]] + class azure.ai.projects.models.LiveDelegationReasoningInputParam(_Model): + effort: Optional[Union[str, LiveReasoningEffort]] + summary: Optional[Union[str, LiveReasoningSummary]] @overload def __init__( self, *, - text: str, + effort: Optional[Union[str, LiveReasoningEffort]] = ..., + summary: Optional[Union[str, LiveReasoningSummary]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveDelegationTextInputParam(_Model): + verbosity: Optional[Union[str, LiveTextVerbosity]] + + @overload + def __init__( + self, + *, + verbosity: Optional[Union[str, LiveTextVerbosity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveDetailEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + HIGH = "high" + LOW = "low" + ORIGINAL = "original" + + + class azure.ai.projects.models.LiveFileSearchToolInputParam(_Model): + type: Literal["file_search"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveFunctionToolChoiceParam(_Model): + name: str + type: Literal["function"] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveFunctionToolInputParam(_Model): + description: Optional[str] + name: str + parameters: Optional[dict[str, Any]] + strict: Optional[bool] + type: Literal["function"] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + parameters: Optional[dict[str, Any]] = ..., + strict: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveHostedShellContainerAutoParam(_Model): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, LiveContainerMemoryLimit]] + network_policy: Optional[Union[LiveContainerNetworkPolicyDisabledParam, LiveHostedShellNetworkPolicyAllowlistParam]] + skills: Optional[list[Union[LiveSkillReferenceParam, LiveInlineSkillParam]]] + type: Literal["container_auto"] + + @overload + def __init__( + self, + *, + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, LiveContainerMemoryLimit]] = ..., + network_policy: Optional[Union[LiveContainerNetworkPolicyDisabledParam, LiveHostedShellNetworkPolicyAllowlistParam]] = ..., + skills: Optional[list[Union[LiveSkillReferenceParam, LiveInlineSkillParam]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveHostedShellNetworkPolicyAllowlistParam(_Model): + allowed_domains: list[str] + type: Literal["allowlist"] + + @overload + def __init__( + self, + *, + allowed_domains: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveHostedShellToolInputParam(_Model): + environment: Optional[Union[LiveHostedShellContainerAutoParam, LiveContainerReferenceParam, LiveLocalEnvironmentParam]] + type: Literal["shell"] + + @overload + def __init__( + self, + *, + environment: Optional[Union[LiveHostedShellContainerAutoParam, LiveContainerReferenceParam, LiveLocalEnvironmentParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveImageGenerationToolInputParam(_Model): + type: Literal["image_generation"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveInitialAssistantMessageItemParam(LiveInitialItem, discriminator='assistant'): + content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]] + id: Optional[str] + role: Literal[LiveInitialItemType.ASSISTANT] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] + + @overload + def __init__( + self, + *, + content: list[Union[LiveInitialTextContentPartParam, LiveInitialOutputTextContentPartParam]], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialDeveloperMessageItemParam(LiveInitialItem, discriminator='developer'): + content: list[LiveInitialInputTextContentPartParam] + id: Optional[str] + role: Literal[LiveInitialItemType.DEVELOPER] + status: Optional[Union[str, LiveInitialMessageStatus]] + type: Optional[Literal["message"]] + + @overload + def __init__( + self, + *, + content: list[LiveInitialInputTextContentPartParam], + id: Optional[str] = ..., + status: Optional[Union[str, LiveInitialMessageStatus]] = ..., + type: Optional[Literal[message]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialInputTextContentPartParam(_Model): + text: str + type: Optional[Literal["input_text"]] + + @overload + def __init__( + self, + *, + text: str, + type: Optional[Literal[input_text]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialItem(_Model): + role: str + + @overload + def __init__( + self, + *, + role: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + DEVELOPER = "developer" + USER = "user" + + + class azure.ai.projects.models.LiveInitialMessageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + INCOMPLETE = "incomplete" + + + class azure.ai.projects.models.LiveInitialOutputTextContentPartParam(_Model): + text: str + type: Literal["output_text"] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialSessionAudioOutputParam(_Model): + voice: Optional[Union[str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], Literal["bossa"], Literal["brise"], Literal["cedar"], Literal["cinder"], Literal["coral"], Literal["delta"], Literal["echo"], Literal["flitz"], Literal["gleam"], Literal["harema"], Literal["juni"], Literal["marin"], Literal["meridian"], Literal["nira"], Literal["noeul"], Literal["nuri"], Literal["quartz"], Literal["ripple"], Literal["sage"], Literal["shida"], Literal["shimmer"], Literal["sillage"], Literal["stone"], Literal["tempo"], Literal["verse"], Literal["vesper"], Literal["willow"], LiveCustomVoiceParam]] + + @overload + def __init__( + self, + *, + voice: Optional[Union[str, Literal[alloy], Literal[ash], Literal[ballad], Literal[beacon], Literal[bossa], Literal[brise], Literal[cedar], Literal[cinder], Literal[coral], Literal[delta], Literal[echo], Literal[flitz], Literal[gleam], Literal[harema], Literal[juni], Literal[marin], Literal[meridian], Literal[nira], Literal[noeul], Literal[nuri], Literal[quartz], Literal[ripple], Literal[sage], Literal[shida], Literal[shimmer], Literal[sillage], Literal[stone], Literal[tempo], Literal[verse], Literal[vesper], Literal[willow], LiveCustomVoiceParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialSessionAudioParam(_Model): + format: Optional[LiveAudioFormat] + output: Optional[LiveInitialSessionAudioOutputParam] + + @overload + def __init__( + self, + *, + format: Optional[LiveAudioFormat] = ..., + output: Optional[LiveInitialSessionAudioOutputParam] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInitialTextContentPartParam(_Model): + text: str + type: Optional[Literal["text"]] + + @overload + def __init__( + self, + *, + text: str, type: Optional[Literal[text]] = ... ) -> None: ... @@ -9347,6 +9737,41 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveInlineSkillParam(_Model): + description: str + name: str + source: LiveInlineSkillSourceParam + type: Literal["inline"] + + @overload + def __init__( + self, + *, + description: str, + name: str, + source: LiveInlineSkillSourceParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveInlineSkillSourceParam(_Model): + data: str + media_type: Literal["application/zip"] + type: Literal["base64"] + + @overload + def __init__( + self, + *, + data: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveInputAudioAppend(LiveServerEvent, discriminator='session.input_audio.append'): audio: str type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] @@ -9384,8 +9809,41 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveLocalEnvironmentParam(_Model): + skills: Optional[list[LiveLocalSkillParam]] + type: Literal["local"] + + @overload + def __init__( + self, + *, + skills: Optional[list[LiveLocalSkillParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveLocalSkillParam(_Model): + description: str + name: str + path: str + + @overload + def __init__( + self, + *, + description: str, + name: str, + path: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveMCPToolChoiceParam(_Model): - name: str + name: Optional[str] server_label: str type: Literal["mcp"] @@ -9393,7 +9851,7 @@ namespace azure.ai.projects.models def __init__( self, *, - name: str, + name: Optional[str] = ..., server_label: str ) -> None: ... @@ -9401,6 +9859,26 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveMCPToolInputParam(_Model): + type: Literal["mcp"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveNamespaceToolInputParam(_Model): + type: Literal["namespace"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + class azure.ai.projects.models.LiveOutputAudioDelta(LiveServerEvent, discriminator='session.output_audio.delta'): delta: str end_ms: Optional[int] @@ -9420,6 +9898,16 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveProgrammaticToolInputParam(_Model): + type: Literal["programmatic_tool_calling"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + class azure.ai.projects.models.LiveReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): HIGH = "high" LOW = "low" @@ -9458,8 +9946,8 @@ namespace azure.ai.projects.models reasoning: Optional[LiveDelegationReasoningInputParam] service_tier: Optional[Union[str, LiveResponsesServiceTier]] text: Optional[LiveDelegationTextInputParam] - tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] - tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] @overload def __init__( @@ -9472,8 +9960,8 @@ namespace azure.ai.projects.models reasoning: Optional[LiveDelegationReasoningInputParam] = ..., service_tier: Optional[Union[str, LiveResponsesServiceTier]] = ..., text: Optional[LiveDelegationTextInputParam] = ..., - tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] = ..., - tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] = ... + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] = ..., + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] = ... ) -> None: ... @overload @@ -9488,8 +9976,8 @@ namespace azure.ai.projects.models reasoning: Optional[LiveDelegationReasoningInputParam] service_tier: Optional[Union[str, LiveResponsesServiceTier]] text: Optional[LiveDelegationTextInputParam] - tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] - tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] @overload def __init__( @@ -9502,8 +9990,8 @@ namespace azure.ai.projects.models reasoning: Optional[LiveDelegationReasoningInputParam] = ..., service_tier: Optional[Union[str, LiveResponsesServiceTier]] = ..., text: Optional[LiveDelegationTextInputParam] = ..., - tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam]] = ..., - tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam]]] = ... + tool_choice: Optional[Union[str, LiveToolChoiceEnum, LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam]] = ..., + tools: Optional[list[Union[LiveFunctionToolInputParam, LiveWebSearchToolInputParam, LiveFileSearchToolInputParam, LiveCodeInterpreterToolInputParam, LiveHostedShellToolInputParam, LiveImageGenerationToolInputParam, LiveMCPToolInputParam, LiveCustomToolInputParam, LiveNamespaceToolInputParam, LiveToolSearchToolInputParam, LiveProgrammaticToolInputParam, LiveComputerToolInputParam, LiveApplyPatchToolInputParam]]] = ... ) -> None: ... @overload @@ -9569,6 +10057,69 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveServerEventLiveDecisionEvent(LiveServerEvent, discriminator='decision.event'): + delegation_id: str + event: LiveDecisionCompleted + event_id: str + source_event_id: str + source_event_type: Literal["delta", "delta"] + trigger_id: str + type: Literal[LiveServerEventType.DECISION_EVENT] + + @overload + def __init__( + self, + *, + delegation_id: str, + event: LiveDecisionCompleted, + event_id: str, + source_event_id: str, + source_event_type: Literal["delta", "delta"], + trigger_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveDecisionItemCreated(LiveServerEvent, discriminator='decision.item.created'): + client_event_id: Optional[str] + event_id: str + item: LiveDecisionStoredInputItemParam + type: Literal[LiveServerEventType.DECISION_ITEM_CREATED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str, + item: LiveDecisionStoredInputItemParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveDecisionItemDeleted(LiveServerEvent, discriminator='decision.item.deleted'): + client_event_id: Optional[str] + event_id: str + item_id: str + type: Literal[LiveServerEventType.DECISION_ITEM_DELETED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str, + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveServerEventLiveDelegationCreated(LiveServerEvent, discriminator='session.delegation.created'): client_event_id: Optional[str] delegation: VoiceAgentLiveDelegationItem @@ -9708,6 +10259,40 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlayed(LiveServerEvent, discriminator='session.output_audio.fixture.played'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlaying(LiveServerEvent, discriminator='session.output_audio.fixture.playing'): + client_event_id: Optional[str] + event_id: str + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING] + + @overload + def __init__( + self, + *, + client_event_id: Optional[str] = ..., + event_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveServerEventLiveOutputTranscriptDelta(LiveServerEvent, discriminator='session.output_transcript.delta'): client_event_id: Optional[str] delta: str @@ -9857,7 +10442,63 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveServerEventLiveTransportAnswered(LiveServerEvent, discriminator='transport.answered'): + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveTransportFailed(LiveServerEvent, discriminator='transport.failed'): + error: LiveTransportCallError + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_FAILED] + + @overload + def __init__( + self, + *, + error: LiveTransportCallError, + event_id: str, + session_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveServerEventLiveTransportRinging(LiveServerEvent, discriminator='transport.ringing'): + event_id: str + session_id: str + type: Literal[LiveServerEventType.TRANSPORT_RINGING] + + @overload + def __init__( + self, + *, + event_id: str, + session_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECISION_EVENT = "decision.event" + DECISION_ITEM_CREATED = "decision.item.created" + DECISION_ITEM_DELETED = "decision.item.deleted" ERROR = "error" INFO = "info" RESPONSE_EVENT = "response.event" @@ -9870,6 +10511,8 @@ namespace azure.ai.projects.models SESSION_INPUT_TRANSCRIPT_DELTA = "session.input_transcript.delta" SESSION_INSTRUCTIONS_APPENDED = "session.instructions.appended" SESSION_OUTPUT_AUDIO_DELTA = "session.output_audio.delta" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED = "session.output_audio.fixture.played" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING = "session.output_audio.fixture.playing" SESSION_OUTPUT_TRANSCRIPT_DELTA = "session.output_transcript.delta" SESSION_STARTED = "session.started" SESSION_THINKING_APPENDED = "session.thinking.appended" @@ -9890,112 +10533,238 @@ namespace azure.ai.projects.models def __init__( self, *, - rate: int + rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionAudioFormatPCMParam(LiveAudioFormat, discriminator='audio/pcm'): + rate: Literal[16000, 24000] + type: Literal[LiveAudioFormatType.AUDIO_PCM] + + @overload + def __init__( + self, + *, + rate: Literal[16000, 24000] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionAudioFormatPCMUParam(LiveAudioFormat, discriminator='audio/pcmu'): + rate: int + type: Literal[LiveAudioFormatType.AUDIO_PCMU] + + @overload + def __init__( + self, + *, + rate: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionCreateParams(_Model): + audio: Optional[LiveInitialSessionAudioParam] + client: Optional[LiveClientConfigParam] + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam, LiveDecisionsDelegationParam_2]] + input: Optional[list[LiveInitialItem]] + instructions: Optional[str] + model: Union[str, ModelIdsLive] + store: Optional[bool] + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] + + @overload + def __init__( + self, + *, + audio: Optional[LiveInitialSessionAudioParam] = ..., + client: Optional[LiveClientConfigParam] = ..., + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam, LiveDecisionsDelegationParam_2]] = ..., + input: Optional[list[LiveInitialItem]] = ..., + instructions: Optional[str] = ..., + model: Union[str, ModelIdsLive], + store: Optional[bool] = ..., + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionStartEvent(LiveClientEvent, discriminator='session.start'): + event_id: Optional[str] + session: LiveSessionCreateParams + type: Literal[LiveClientEventType.SESSION_START] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: LiveSessionCreateParams + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionUpdateParams(_Model): + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam, LiveDecisionsDelegationUpdateParam]] + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] + + @overload + def __init__( + self, + *, + delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam, LiveDecisionsDelegationUpdateParam]] = ..., + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LiveSessionUsage(_Model): + seconds: float + + @overload + def __init__( + self, + *, + seconds: float ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveSessionAudioFormatPCMParam(LiveAudioFormat, discriminator='audio/pcm'): - rate: Literal[16000, 24000] - type: Literal[LiveAudioFormatType.AUDIO_PCM] + class azure.ai.projects.models.LiveSkillReferenceParam(_Model): + skill_id: str + type: Literal["skill_reference"] + version: Optional[str] @overload def __init__( self, *, - rate: Literal[16000, 24000] + skill_id: str, + version: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveSessionAudioFormatPCMUParam(LiveAudioFormat, discriminator='audio/pcmu'): - rate: int - type: Literal[LiveAudioFormatType.AUDIO_PCMU] + class azure.ai.projects.models.LiveSpecificApplyPatchParam(_Model): + type: Literal["apply_patch"] - @overload def __init__( self, - *, - rate: int + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificCodeInterpreterParam(_Model): + type: Literal["code_interpreter"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveSpecificComputerParam(_Model): + type: Literal["computer"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... - class azure.ai.projects.models.LiveSessionCreateParams(_Model): - audio: Optional[LiveInitialSessionAudioParam] - client: Optional[LiveClientConfigParam] - delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] - input: Optional[list[LiveInitialItem]] - instructions: Optional[str] - model: Union[str, ModelIdsLive] - store: Optional[bool] + + class azure.ai.projects.models.LiveSpecificCustomToolParam(_Model): + name: str + type: Literal["custom"] @overload def __init__( self, *, - audio: Optional[LiveInitialSessionAudioParam] = ..., - client: Optional[LiveClientConfigParam] = ..., - delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationParam]] = ..., - input: Optional[list[LiveInitialItem]] = ..., - instructions: Optional[str] = ..., - model: Union[str, ModelIdsLive], - store: Optional[bool] = ... + name: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveSessionStartEvent(LiveClientEvent, discriminator='session.start'): - event_id: Optional[str] - session: LiveSessionCreateParams - type: Literal[LiveClientEventType.SESSION_START] + class azure.ai.projects.models.LiveSpecificFileSearchParam(_Model): + type: Literal["file_search"] - @overload def __init__( self, - *, - event_id: Optional[str] = ..., - session: LiveSessionCreateParams + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificFunctionShellParam(_Model): + type: Literal["shell"] - class azure.ai.projects.models.LiveSessionUpdateParams(_Model): - delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam]] + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveSpecificImageGenParam(_Model): + type: Literal["image_generation"] - @overload def __init__( self, - *, - delegation: Optional[Union[LiveClientDelegationParam, LiveResponsesDelegationUpdateParam]] = ... + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam(_Model): + type: Literal["programmatic_tool_calling"] - class azure.ai.projects.models.LiveSessionUsage(_Model): - seconds: float + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.LiveSpecificWebSearchParam(_Model): + type: Literal["web_search"] - @overload def __init__( self, - *, - seconds: float + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.LiveSpecificWebSearchPreviewParam(_Model): + type: Literal["web_search_preview"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... class azure.ai.projects.models.LiveTextVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -10010,22 +10779,21 @@ namespace azure.ai.projects.models REQUIRED = "required" - class azure.ai.projects.models.LiveTransportAnswered(LiveServerEvent, discriminator='transport.answered'): - event_id: str - session_id: str - type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] + class azure.ai.projects.models.LiveToolChoiceValueEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.projects.models.LiveToolSearchToolInputParam(_Model): + type: Literal["tool_search"] - @overload def __init__( self, - *, - event_id: str, - session_id: str + *args: Any, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveTransportCallError(_Model): code: str @@ -10064,6 +10832,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.LiveTransportDTMFSend(LiveServerEvent, discriminator='transport.dtmf.send'): + client_event_id: Optional[str] event: str event_id: str type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] @@ -10072,6 +10841,7 @@ namespace azure.ai.projects.models def __init__( self, *, + client_event_id: Optional[str] = ..., event: str, event_id: str ) -> None: ... @@ -10080,42 +10850,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.LiveTransportFailed(LiveServerEvent, discriminator='transport.failed'): - error: LiveTransportCallError - event_id: str - session_id: str - type: Literal[LiveServerEventType.TRANSPORT_FAILED] - - @overload - def __init__( - self, - *, - error: LiveTransportCallError, - event_id: str, - session_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.LiveTransportRinging(LiveServerEvent, discriminator='transport.ringing'): - event_id: str - session_id: str - type: Literal[LiveServerEventType.TRANSPORT_RINGING] - - @overload - def __init__( - self, - *, - event_id: str, - session_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.LiveWebSearchToolInputParam(_Model): type: Literal["web_search"] @@ -10126,25 +10860,6 @@ namespace azure.ai.projects.models ) -> None: ... - class azure.ai.projects.models.LocalShellToolParam(Tool, discriminator='local_shell'): - description: Optional[str] - name: Optional[str] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.LOCAL_SHELL] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.LocalSkillParam(_Model): description: str name: str @@ -10227,7 +10942,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.MCPListToolsToolInputSchema(_Model): - class azure.ai.projects.models.MCPTool(Tool, discriminator='mcp'): + class azure.ai.projects.models.MCPTool(_Model): allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] allowed_tools: Optional[Union[list[str], MCPToolFilter]] authorization: Optional[str] @@ -10241,7 +10956,7 @@ namespace azure.ai.projects.models server_url: Optional[str] tool_configs: Optional[dict[str, ToolConfig]] tunnel_id: Optional[str] - type: Literal[ToolType.MCP] + type: Literal["mcp"] @overload def __init__( @@ -10848,6 +11563,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.MisalignmentErrorDetailsResource(_Model): detailed_explanation: Optional[str] error_type: Optional[Union[str, MisalignmentErrorType]] + review_target: Optional[str] steer: Optional[MisalignmentSteer] @overload @@ -10856,6 +11572,7 @@ namespace azure.ai.projects.models *, detailed_explanation: Optional[str] = ..., error_type: Optional[Union[str, MisalignmentErrorType]] = ..., + review_target: Optional[str] = ..., steer: Optional[MisalignmentSteer] = ... ) -> None: ... @@ -11328,6 +12045,20 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.OutputTokensDetailsResource(_Model): + reasoning_tokens: int + + @overload + def __init__( + self, + *, + reasoning_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.PSTNTelephonyTransferDestination(TelephonyTransferDestination, discriminator='pstn'): kind: Literal[TelephonyTransferDestinationKind.PSTN] value: str @@ -11427,16 +12158,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] - - @overload - def __init__(self) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): harness: Optional[AgentHarness] instructions: Optional[str] @@ -11606,6 +12327,81 @@ namespace azure.ai.projects.models REJECTED = "rejected" + class azure.ai.projects.models.QuestionParam(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.QuestionParamChoice(QuestionParam, discriminator='choice'): + choices: list[ChoiceOptionParam] + instructions: str + name: Optional[str] + type: Literal[QuestionParamType.CHOICE] + + @overload + def __init__( + self, + *, + choices: list[ChoiceOptionParam], + instructions: str, + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.QuestionParamPredicate(QuestionParam, discriminator='predicate'): + instructions: str + name: Optional[str] + type: Literal[QuestionParamType.PREDICATE] + + @overload + def __init__( + self, + *, + instructions: str, + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.QuestionParamScore(QuestionParam, discriminator='score'): + instructions: str + levels: list[ScoreLevelParam] + name: Optional[str] + type: Literal[QuestionParamType.SCORE] + + @overload + def __init__( + self, + *, + instructions: str, + levels: list[ScoreLevelParam], + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.QuestionParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHOICE = "choice" + PREDICATE = "predicate" + SCORE = "score" + + class azure.ai.projects.models.RaiConfig(_Model): invocations_moderation: Optional[RaiInvocationModeration] rai_policy_name: str @@ -12415,6 +13211,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.RealtimeResponseStatusDetailsError(_Model): code: Optional[str] + message: Optional[str] type: Optional[str] @overload @@ -12422,6 +13219,7 @@ namespace azure.ai.projects.models self, *, code: Optional[str] = ..., + message: Optional[str] = ..., type: Optional[str] = ... ) -> None: ... @@ -13823,6 +14621,28 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ResponseUsageResource(_Model): + input_tokens: int + input_tokens_details: InputTokensDetailsResource + output_tokens: int + output_tokens_details: OutputTokensDetailsResource + total_tokens: int + + @overload + def __init__( + self, + *, + input_tokens: int, + input_tokens_details: InputTokensDetailsResource, + output_tokens: int, + output_tokens_details: OutputTokensDetailsResource, + total_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.ResponsesProtocolConfiguration(_Model): @@ -14192,6 +15012,40 @@ namespace azure.ai.projects.models INSIGHT = "Insight" + class azure.ai.projects.models.ScoreLevelParam(_Model): + description: Optional[str] + label: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScoreProbabilityResource(_Model): + label: str + probability: float + value: int + + @overload + def __init__( + self, + *, + label: str, + probability: float, + value: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): IMAGE = "image" TEXT = "text" @@ -15558,6 +16412,21 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ToolApplyPatchToolParam(Tool, discriminator='apply_patch'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + type: Literal[ToolType.APPLY_PATCH] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): mode: Literal["auto", "required"] tools: list[dict[str, Any]] @@ -15730,51 +16599,316 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator='web_search_preview_2025_03_11'): - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + class azure.ai.projects.models.ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator='web_search_preview_2025_03_11'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolCodeInterpreterTool(Tool, discriminator='code_interpreter'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + container: Optional[Union[str, AutoCodeInterpreterToolParam]] + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.CODE_INTERPRETER] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolComputerTool(Tool, discriminator='computer'): + type: Literal[ToolType.COMPUTER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolComputerUsePreviewTool(Tool, discriminator='computer_use_preview'): + display_height: int + display_width: int + environment: Union[str, ComputerEnvironment] + type: Literal[ToolType.COMPUTER_USE_PREVIEW] + + @overload + def __init__( + self, + *, + display_height: int, + display_width: int, + environment: Union[str, ComputerEnvironment] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolConfig(_Model): + additional_search_text: Optional[str] + pin: Optional[bool] + + @overload + def __init__( + self, + *, + additional_search_text: Optional[str] = ..., + pin: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolCustomToolParam(Tool, discriminator='custom'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + async_property: Optional[bool] + defer_loading: Optional[bool] + description: Optional[str] + format: Optional[CustomToolParamFormat] + name: str + type: Literal[ToolType.CUSTOM] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + async_property: Optional[bool] = ..., + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + format: Optional[CustomToolParamFormat] = ..., + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolDescription(_Model): + description: Optional[str] + name: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): + key "description": str + key "name": str + + + class azure.ai.projects.models.ToolFileSearchTool(Tool, discriminator='file_search'): + description: Optional[str] + filters: Optional[Filters] + max_num_results: Optional[int] + name: Optional[str] + ranking_options: Optional[RankingOptions] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.FILE_SEARCH] + vector_store_ids: list[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + filters: Optional[Filters] = ..., + max_num_results: Optional[int] = ..., + name: Optional[str] = ..., + ranking_options: Optional[RankingOptions] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + vector_store_ids: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolFunctionShellToolParam(Tool, discriminator='shell'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + description: Optional[str] + environment: Optional[FunctionShellToolParamEnvironment] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.SHELL] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + description: Optional[str] = ..., + environment: Optional[FunctionShellToolParamEnvironment] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolFunctionTool(Tool, discriminator='function'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + async_property: Optional[bool] + defer_loading: Optional[bool] + description: Optional[str] + name: str + output_schema: Optional[dict[str, Any]] + parameters: dict[str, Any] + strict: bool + type: Literal[ToolType.FUNCTION] + + @overload + def __init__( + self, + *, + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + async_property: Optional[bool] = ..., + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + name: str, + output_schema: Optional[dict[str, Any]] = ..., + parameters: dict[str, Any], + strict: bool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolImageGenTool(Tool, discriminator='image_generation'): + action: Optional[Union[str, ImageGenAction]] + background: Optional[Literal["transparent", "opaque", "auto"]] + description: Optional[str] + input_fidelity: Optional[Union[str, InputFidelity]] + input_image_mask: Optional[ImageGenToolInputImageMask] + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-5-sunburst"], Literal["gpt-image-5-sunburst-2026-09-08"], Literal["gpt-image-5-flare"], Literal["gpt-image-5-flare-2026-09-08"], str]] + moderation: Optional[Literal["auto", "low"]] + name: Optional[str] + output_compression: Optional[int] + output_format: Optional[Literal["png", "webp", "jpeg"]] + partial_images: Optional[int] + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.IMAGE_GENERATION] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + action: Optional[Union[str, ImageGenAction]] = ..., + background: Optional[Literal[transparent, opaque, auto]] = ..., + description: Optional[str] = ..., + input_fidelity: Optional[Union[str, InputFidelity]] = ..., + input_image_mask: Optional[ImageGenToolInputImageMask] = ..., + model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], Literal[gpt-image-5-sunburst], Literal[gpt-image-5-sunburst-2026-09-08], Literal[gpt-image-5-flare], Literal[gpt-image-5-flare-2026-09-08], str]] = ..., + moderation: Optional[Literal[auto, low]] = ..., + name: Optional[str] = ..., + output_compression: Optional[int] = ..., + output_format: Optional[Literal[png, webp, jpeg]] = ..., + partial_images: Optional[int] = ..., + quality: Optional[Literal[low, medium, high, xhigh, max, auto]] = ..., + size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolConfig(_Model): - additional_search_text: Optional[str] - pin: Optional[bool] + class azure.ai.projects.models.ToolLocalShellToolParam(Tool, discriminator='local_shell'): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.LOCAL_SHELL] @overload def __init__( self, *, - additional_search_text: Optional[str] = ..., - pin: Optional[bool] = ... + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolDescription(_Model): - description: Optional[str] - name: Optional[str] + class azure.ai.projects.models.ToolMcpTool(Tool, discriminator='mcp'): + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + tunnel_id: Optional[str] + type: Literal[ToolType.MCP] @overload def __init__( self, *, - description: Optional[str] = ..., - name: Optional[str] = ... + allowed_callers: Optional[list[Union[str, CallableToolAllowedCaller]]] = ..., + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + tunnel_id: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): - key "description": str - key "name": str + class azure.ai.projects.models.ToolProgrammaticToolCallingParam(Tool, discriminator='programmatic_tool_calling'): + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... class azure.ai.projects.models.ToolProjectConnection(_Model): @@ -15796,38 +16930,38 @@ namespace azure.ai.projects.models SERVER = "server" - class azure.ai.projects.models.ToolSearchToolParam(Tool, discriminator='tool_search'): - description: Optional[str] - execution: Optional[Union[str, ToolSearchExecutionType]] - parameters: Optional[EmptyModelParam] - type: Literal[ToolType.TOOL_SEARCH] + class azure.ai.projects.models.ToolSearchToolboxTool(ToolboxTool, discriminator='toolbox_search'): + description: str + name: str + tool_configs: dict[str, ToolConfig] + type: Literal[ToolboxToolType.TOOLBOX_SEARCH] @overload def __init__( self, *, description: Optional[str] = ..., - execution: Optional[Union[str, ToolSearchExecutionType]] = ..., - parameters: Optional[EmptyModelParam] = ... + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ToolSearchToolboxTool(ToolboxTool, discriminator='toolbox_search'): - description: str - name: str - tool_configs: dict[str, ToolConfig] - type: Literal[ToolboxToolType.TOOLBOX_SEARCH] + class azure.ai.projects.models.ToolToolSearchToolParam(Tool, discriminator='tool_search'): + description: Optional[str] + execution: Optional[Union[str, ToolSearchExecutionType]] + parameters: Optional[EmptyModelParam] + type: Literal[ToolType.TOOL_SEARCH] @overload def __init__( self, *, description: Optional[str] = ..., - name: Optional[str] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ... + execution: Optional[Union[str, ToolSearchExecutionType]] = ..., + parameters: Optional[EmptyModelParam] = ... ) -> None: ... @overload @@ -15891,6 +17025,54 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.ToolWebSearchPreviewTool(Tool, discriminator='web_search_preview'): + search_content_types: Optional[list[Union[str, SearchContentType]]] + search_context_size: Optional[Union[str, SearchContextSize]] + type: Literal[ToolType.WEB_SEARCH_PREVIEW] + user_location: Optional[ApproximateLocation] + + @overload + def __init__( + self, + *, + search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., + search_context_size: Optional[Union[str, SearchContextSize]] = ..., + user_location: Optional[ApproximateLocation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolWebSearchTool(Tool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: Optional[str] + external_web_access: Optional[bool] + filters: Optional[WebSearchToolFilters] + name: Optional[str] + search_context_size: Optional[Literal["low", "medium", "high"]] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.WEB_SEARCH] + user_location: Optional[WebSearchApproximateLocation] + + @overload + def __init__( + self, + *, + custom_search_configuration: Optional[WebSearchConfiguration] = ..., + description: Optional[str] = ..., + external_web_access: Optional[bool] = ..., + filters: Optional[WebSearchToolFilters] = ..., + name: Optional[str] = ..., + search_context_size: Optional[Literal[low, medium, high]] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + user_location: Optional[WebSearchApproximateLocation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.ToolboxObject(_Model): default_version: str id: str @@ -17073,6 +18255,7 @@ namespace azure.ai.projects.models output_modalities: Optional[list[Union[str, VoiceOutputModality]]] parallel_tool_calls: Optional[bool] rai_config: RaiConfig + soundscape: Optional[VoiceAgentSoundscapeConfig] store: bool structured_inputs: dict[str, StructuredInputDefinition] sub_protocol: Optional[Literal["realtime"]] @@ -17097,6 +18280,7 @@ namespace azure.ai.projects.models output_modalities: Optional[list[Union[str, VoiceOutputModality]]] = ..., parallel_tool_calls: Optional[bool] = ..., rai_config: Optional[RaiConfig] = ..., + soundscape: Optional[VoiceAgentSoundscapeConfig] = ..., store: Optional[bool] = ..., structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., sub_protocol: Optional[Literal[realtime]] = ..., @@ -17244,6 +18428,7 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_SPEECH = "azure-speech" + AZURE_SPEECH_STREAMING = "azure-speech-streaming" GPT4_O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe" GPT4_O_TRANSCRIBE = "gpt-4o-transcribe" GPT4_O_TRANSCRIBE_DIARIZE = "gpt-4o-transcribe-diarize" @@ -17589,6 +18774,7 @@ namespace azure.ai.projects.models model: Union[str, ModelIdsLive] status: Literal["active"] store: Optional[bool] + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] @overload def __init__( @@ -17602,7 +18788,8 @@ namespace azure.ai.projects.models input: Optional[list[LiveInitialItem]] = ..., instructions: Optional[str] = ..., model: Union[str, ModelIdsLive], - store: Optional[bool] = ... + store: Optional[bool] = ..., + triggers: Optional[list[LiveDecisionTriggerInputParam_2]] = ... ) -> None: ... @overload @@ -17702,6 +18889,8 @@ namespace azure.ai.projects.models class azure.ai.projects.models.VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" + AZURE_DEEP_NOISE_SUPPRESSION_HEADSET = "azure_deep_noise_suppression_headset" + AZURE_PERSONAL_NOISE_SUPPRESSION = "azure_personal_noise_suppression" FAR_FIELD = "far_field" NEAR_FIELD = "near_field" @@ -18348,6 +19537,87 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.ai.projects.models.VoiceAgentSoundscapeConfig(_Model): + background: Optional[VoiceAgentSoundscapeTrackConfig] + closing: Optional[VoiceAgentSoundscapeTrackConfig] + opening: Optional[VoiceAgentSoundscapeTrackConfig] + transfer: Optional[VoiceAgentSoundscapeTrackConfig] + working: Optional[VoiceAgentSoundscapeWorkingTrackConfig] + + @overload + def __init__( + self, + *, + background: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + closing: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + opening: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + transfer: Optional[VoiceAgentSoundscapeTrackConfig] = ..., + working: Optional[VoiceAgentSoundscapeWorkingTrackConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeSound(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUSY_STREET = "busy_street" + CALL_CENTER = "call_center" + DING1 = "ding1" + DING2 = "ding2" + OFFICE = "office" + PEOPLE_TALKING = "people_talking" + STREET_AND_METRO_STATION = "street_and_metro_station" + + + class azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig(_Model): + name: Union[str, VoiceAgentSoundscapeSound] + type: Literal["built_in"] + + @overload + def __init__( + self, + *, + name: Union[str, VoiceAgentSoundscapeSound] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig(_Model): + gain: Optional[float] + source: VoiceAgentSoundscapeSourceConfig + + @overload + def __init__( + self, + *, + gain: Optional[float] = ..., + source: VoiceAgentSoundscapeSourceConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig(_Model): + delay_ms: Optional[timedelta] + gain: Optional[float] + source: VoiceAgentSoundscapeSourceConfig + + @overload + def __init__( + self, + *, + delay_ms: Optional[timedelta] = ..., + gain: Optional[float] = ..., + source: VoiceAgentSoundscapeSourceConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig(VoiceAgentInterimResponseConfig, discriminator='static_interim_response'): latency_threshold_ms: timedelta texts: Optional[list[str]] @@ -18946,54 +20216,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.WebSearchPreviewTool(Tool, discriminator='web_search_preview'): - search_content_types: Optional[list[Union[str, SearchContentType]]] - search_context_size: Optional[Union[str, SearchContextSize]] - type: Literal[ToolType.WEB_SEARCH_PREVIEW] - user_location: Optional[ApproximateLocation] - - @overload - def __init__( - self, - *, - search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., - search_context_size: Optional[Union[str, SearchContextSize]] = ..., - user_location: Optional[ApproximateLocation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.WebSearchTool(Tool, discriminator='web_search'): - custom_search_configuration: Optional[WebSearchConfiguration] - description: Optional[str] - external_web_access: Optional[bool] - filters: Optional[WebSearchToolFilters] - name: Optional[str] - search_context_size: Optional[Literal["low", "medium", "high"]] - tool_configs: Optional[dict[str, ToolConfig]] - type: Literal[ToolType.WEB_SEARCH] - user_location: Optional[WebSearchApproximateLocation] - - @overload - def __init__( - self, - *, - custom_search_configuration: Optional[WebSearchConfiguration] = ..., - description: Optional[str] = ..., - external_web_access: Optional[bool] = ..., - filters: Optional[WebSearchToolFilters] = ..., - name: Optional[str] = ..., - search_context_size: Optional[Literal[low, medium, high]] = ..., - tool_configs: Optional[dict[str, ToolConfig]] = ..., - user_location: Optional[WebSearchApproximateLocation] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.WebSearchToolFilters(_Model): allowed_domains: Optional[list[str]] diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index a76938808223..ba91d1625bce 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: b9dab8e10c9c0ea2ede30861977bf9d23332477f69e250c79e4a32de8b0531f8 +apiHash: b12c6367b4159869109631a33624581dbebae2c2d6d73b08e4432108bcbb30e8 packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.10 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 9aaa4468bfdb..821edab4b285 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -97,10 +97,14 @@ "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", "azure.ai.projects.models.AISearchIndexResource": "Azure.AI.Projects.AISearchIndexResource", + "azure.ai.projects.models.AnswerResource": "OpenAI.AnswerResource", + "azure.ai.projects.models.AnswerResourceChoice": "OpenAI.AnswerResourceChoice", + "azure.ai.projects.models.AnswerResourcePredicate": "OpenAI.AnswerResourcePredicate", + "azure.ai.projects.models.AnswerResourceRefusal": "OpenAI.AnswerResourceRefusal", + "azure.ai.projects.models.AnswerResourceScore": "OpenAI.AnswerResourceScore", "azure.ai.projects.models.ApiError": "OpenAI.Error", "azure.ai.projects.models.ApiErrorResponse": "Azure.AI.Projects.ApiErrorResponse", "azure.ai.projects.models.ApiKeyCredentials": "Azure.AI.Projects.ApiKeyCredentials", - "azure.ai.projects.models.ApplyPatchToolParam": "OpenAI.ApplyPatchToolParam", "azure.ai.projects.models.ApproximateLocation": "OpenAI.ApproximateLocation", "azure.ai.projects.models.ArtifactProfile": "Azure.AI.Projects.ArtifactProfile", "azure.ai.projects.models.AutoCodeInterpreterToolParam": "OpenAI.AutoCodeInterpreterToolParam", @@ -141,17 +145,16 @@ "azure.ai.projects.models.ChatCompletionTool": "OpenAI.ChatCompletionTool", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", "azure.ai.projects.models.ChatSummaryMemoryItem": "Azure.AI.Projects.ChatSummaryMemoryItem", + "azure.ai.projects.models.ChoiceOptionParam": "OpenAI.ChoiceOptionParam", + "azure.ai.projects.models.ChoiceProbabilityResource": "OpenAI.ChoiceProbabilityResource", "azure.ai.projects.models.ClusterInsightResult": "Azure.AI.Projects.ClusterInsightResult", "azure.ai.projects.models.ClusterTokenUsage": "Azure.AI.Projects.ClusterTokenUsage", "azure.ai.projects.models.EvaluatorDefinition": "Azure.AI.Projects.EvaluatorDefinition", "azure.ai.projects.models.CodeBasedEvaluatorDefinition": "Azure.AI.Projects.CodeBasedEvaluatorDefinition", "azure.ai.projects.models.CodeConfiguration": "Azure.AI.Projects.CodeConfiguration", - "azure.ai.projects.models.CodeInterpreterTool": "OpenAI.CodeInterpreterTool", "azure.ai.projects.models.CodeInterpreterToolboxTool": "Azure.AI.Projects.CodeInterpreterToolboxTool", "azure.ai.projects.models.ComparisonFilter": "OpenAI.ComparisonFilter", "azure.ai.projects.models.CompoundFilter": "OpenAI.CompoundFilter", - "azure.ai.projects.models.ComputerTool": "OpenAI.ComputerTool", - "azure.ai.projects.models.ComputerUsePreviewTool": "OpenAI.ComputerUsePreviewTool", "azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection", "azure.ai.projects.models.FunctionShellToolParamEnvironment": "OpenAI.FunctionShellToolParamEnvironment", "azure.ai.projects.models.ContainerAutoParam": "OpenAI.ContainerAutoParam", @@ -194,6 +197,7 @@ "azure.ai.projects.models.DatasetEvaluatorGenerationJobSource": "Azure.AI.Projects.DatasetEvaluatorGenerationJobSource", "azure.ai.projects.models.DatasetReference": "Azure.AI.Projects.DatasetReference", "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", + "azure.ai.projects.models.DecisionResponse": "OpenAI.DecisionResponse", "azure.ai.projects.models.Delegation": "OpenAI.delegation", "azure.ai.projects.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", "azure.ai.projects.models.DeleteAgentVersionResponse": "Azure.AI.Projects.DeleteAgentVersionResponse", @@ -245,7 +249,6 @@ "azure.ai.projects.models.FileDataGenerationJobOutput": "Azure.AI.Projects.FileDataGenerationJobOutput", "azure.ai.projects.models.FileDataGenerationJobSource": "Azure.AI.Projects.FileDataGenerationJobSource", "azure.ai.projects.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion", - "azure.ai.projects.models.FileSearchTool": "OpenAI.FileSearchTool", "azure.ai.projects.models.FileSearchToolboxTool": "Azure.AI.Projects.FileSearchToolboxTool", "azure.ai.projects.models.VersionSelectionRule": "Azure.AI.Projects.VersionSelectionRule", "azure.ai.projects.models.FixedRatioVersionSelectionRule": "Azure.AI.Projects.FixedRatioVersionSelectionRule", @@ -253,10 +256,8 @@ "azure.ai.projects.models.FoundryModelWarning": "Azure.AI.Projects.FoundryModelWarning", "azure.ai.projects.models.FunctionObject": "OpenAI.FunctionObject", "azure.ai.projects.models.FunctionParameters": "OpenAI.FunctionParameters", - "azure.ai.projects.models.FunctionShellToolParam": "OpenAI.FunctionShellToolParam", "azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam": "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam", "azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam": "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam", - "azure.ai.projects.models.FunctionTool": "OpenAI.FunctionTool", "azure.ai.projects.models.FunctionToolParam": "OpenAI.FunctionToolParam", "azure.ai.projects.models.GenerateVoiceAgentRequest": "Azure.AI.Projects.GenerateVoiceAgentRequest", "azure.ai.projects.models.GitHubCopilotHarness": "Azure.AI.Projects.GitHubCopilotHarness", @@ -270,10 +271,10 @@ "azure.ai.projects.models.HourlyRecurrenceSchedule": "Azure.AI.Projects.HourlyRecurrenceSchedule", "azure.ai.projects.models.HumanEvaluationPreviewRuleAction": "Azure.AI.Projects.HumanEvaluationPreviewRuleAction", "azure.ai.projects.models.HybridSearchOptions": "OpenAI.HybridSearchOptions", - "azure.ai.projects.models.ImageGenTool": "OpenAI.ImageGenTool", "azure.ai.projects.models.ImageGenToolInputImageMask": "OpenAI.ImageGenToolInputImageMask", "azure.ai.projects.models.InlineSkillParam": "OpenAI.InlineSkillParam", "azure.ai.projects.models.InlineSkillSourceParam": "OpenAI.InlineSkillSourceParam", + "azure.ai.projects.models.InputTokensDetailsResource": "OpenAI.InputTokensDetailsResource", "azure.ai.projects.models.Insight": "Azure.AI.Projects.Insight", "azure.ai.projects.models.InsightCluster": "Azure.AI.Projects.InsightCluster", "azure.ai.projects.models.InsightModelConfiguration": "Azure.AI.Projects.InsightModelConfiguration", @@ -289,27 +290,54 @@ "azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload": "Azure.AI.Projects.InvokeAgentResponsesApiDispatchPayload", "azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction": "Azure.AI.Projects.InvokeAgentResponsesApiRoutineAction", "azure.ai.projects.models.LiveAllowedServerEventParam": "OpenAI.LiveAllowedServerEventParam", + "azure.ai.projects.models.LiveAllowedToolsChoiceParam": "OpenAI.LiveAllowedToolsChoiceParam", + "azure.ai.projects.models.LiveApplyPatchToolInputParam": "OpenAI.LiveApplyPatchToolInputParam", "azure.ai.projects.models.LiveAudioFormat": "OpenAI.LiveAudioFormat", "azure.ai.projects.models.LiveClientConfigParam": "OpenAI.LiveClientConfigParam", "azure.ai.projects.models.LiveClientDelegationParam": "OpenAI.LiveClientDelegationParam", "azure.ai.projects.models.LiveClientEvent": "OpenAI.LiveClientEvent", "azure.ai.projects.models.LiveClientEventLiveCommentaryAppendParam": "OpenAI.LiveClientEventLiveCommentaryAppendParam", + "azure.ai.projects.models.LiveClientEventLiveDecisionCreateParam": "OpenAI.LiveClientEventLiveDecisionCreateParam", + "azure.ai.projects.models.LiveClientEventLiveDecisionItemCreateParam": "OpenAI.LiveClientEventLiveDecisionItemCreateParam", + "azure.ai.projects.models.LiveClientEventLiveDecisionItemDeleteParam": "OpenAI.LiveClientEventLiveDecisionItemDeleteParam", "azure.ai.projects.models.LiveClientEventLiveInputAudioAppendEvent": "OpenAI.LiveClientEventLiveInputAudioAppendEvent", "azure.ai.projects.models.LiveClientEventLiveInputAudioMuteParam": "OpenAI.LiveClientEventLiveInputAudioMuteParam", "azure.ai.projects.models.LiveClientEventLiveInputAudioUnmuteParam": "OpenAI.LiveClientEventLiveInputAudioUnmuteParam", "azure.ai.projects.models.LiveClientEventLiveInstructionsAppendParam": "OpenAI.LiveClientEventLiveInstructionsAppendParam", + "azure.ai.projects.models.LiveClientEventLiveOutputAudioFixturePlayParam": "OpenAI.LiveClientEventLiveOutputAudioFixturePlayParam", "azure.ai.projects.models.LiveClientEventLiveResponseCreateParam": "OpenAI.LiveClientEventLiveResponseCreateParam", "azure.ai.projects.models.LiveClientEventLiveResponseItemCreateParam": "OpenAI.LiveClientEventLiveResponseItemCreateParam", "azure.ai.projects.models.LiveClientEventLiveSessionCloseParam": "OpenAI.LiveClientEventLiveSessionCloseParam", "azure.ai.projects.models.LiveClientEventLiveSessionUpdateParam": "OpenAI.LiveClientEventLiveSessionUpdateParam", "azure.ai.projects.models.LiveClientEventLiveThinkingAppendParam": "OpenAI.LiveClientEventLiveThinkingAppendParam", + "azure.ai.projects.models.LiveCodeInterpreterToolInputParam": "OpenAI.LiveCodeInterpreterToolInputParam", + "azure.ai.projects.models.LiveComputerToolInputParam": "OpenAI.LiveComputerToolInputParam", + "azure.ai.projects.models.LiveContainerNetworkPolicyDisabledParam": "OpenAI.LiveContainerNetworkPolicyDisabledParam", + "azure.ai.projects.models.LiveContainerReferenceParam": "OpenAI.LiveContainerReferenceParam", "azure.ai.projects.models.LiveContextWindowUsage": "OpenAI.LiveContextWindowUsage", + "azure.ai.projects.models.LiveCustomToolInputParam": "OpenAI.LiveCustomToolInputParam", "azure.ai.projects.models.LiveCustomVoiceParam": "OpenAI.LiveCustomVoiceParam", "azure.ai.projects.models.LiveDataChannelConfigParam": "OpenAI.LiveDataChannelConfigParam", + "azure.ai.projects.models.LiveDecisionCompleted": "OpenAI.LiveDecisionCompleted", + "azure.ai.projects.models.LiveDecisionInputImageParam": "OpenAI.LiveDecisionInputImageParam", + "azure.ai.projects.models.LiveDecisionInputItemParam": "OpenAI.LiveDecisionInputItemParam", + "azure.ai.projects.models.LiveDecisionInputTextParam": "OpenAI.LiveDecisionInputTextParam", + "azure.ai.projects.models.LiveDecisionQuestionsInputParam_2": "OpenAI.LiveDecisionQuestionsInputParam-2", + "azure.ai.projects.models.LiveDecisionsDelegationParam_2": "OpenAI.LiveDecisionsDelegationParam-2", + "azure.ai.projects.models.LiveDecisionsDelegationUpdateParam": "OpenAI.LiveDecisionsDelegationUpdateParam", + "azure.ai.projects.models.LiveDecisionsSettingsInputParam_2": "OpenAI.LiveDecisionsSettingsInputParam-2", + "azure.ai.projects.models.LiveDecisionsSettingsUpdateParam": "OpenAI.LiveDecisionsSettingsUpdateParam", + "azure.ai.projects.models.LiveDecisionStoredInputItemParam": "OpenAI.LiveDecisionStoredInputItemParam", + "azure.ai.projects.models.LiveDecisionTriggerInputParam_2": "OpenAI.LiveDecisionTriggerInputParam-2", "azure.ai.projects.models.LiveDelegationReasoningInputParam": "OpenAI.LiveDelegationReasoningInputParam", "azure.ai.projects.models.LiveDelegationTextInputParam": "OpenAI.LiveDelegationTextInputParam", + "azure.ai.projects.models.LiveFileSearchToolInputParam": "OpenAI.LiveFileSearchToolInputParam", "azure.ai.projects.models.LiveFunctionToolChoiceParam": "OpenAI.LiveFunctionToolChoiceParam", "azure.ai.projects.models.LiveFunctionToolInputParam": "OpenAI.LiveFunctionToolInputParam", + "azure.ai.projects.models.LiveHostedShellContainerAutoParam": "OpenAI.LiveHostedShellContainerAutoParam", + "azure.ai.projects.models.LiveHostedShellNetworkPolicyAllowlistParam": "OpenAI.LiveHostedShellNetworkPolicyAllowlistParam", + "azure.ai.projects.models.LiveHostedShellToolInputParam": "OpenAI.LiveHostedShellToolInputParam", + "azure.ai.projects.models.LiveImageGenerationToolInputParam": "OpenAI.LiveImageGenerationToolInputParam", "azure.ai.projects.models.LiveInitialItem": "OpenAI.LiveInitialItem", "azure.ai.projects.models.LiveInitialAssistantMessageItemParam": "OpenAI.LiveInitialAssistantMessageItemParam", "azure.ai.projects.models.LiveInitialDeveloperMessageItemParam": "OpenAI.LiveInitialDeveloperMessageItemParam", @@ -319,16 +347,26 @@ "azure.ai.projects.models.LiveInitialSessionAudioParam": "OpenAI.LiveInitialSessionAudioParam", "azure.ai.projects.models.LiveInitialTextContentPartParam": "OpenAI.LiveInitialTextContentPartParam", "azure.ai.projects.models.LiveInitialUserMessageItemParam": "OpenAI.LiveInitialUserMessageItemParam", + "azure.ai.projects.models.LiveInlineSkillParam": "OpenAI.LiveInlineSkillParam", + "azure.ai.projects.models.LiveInlineSkillSourceParam": "OpenAI.LiveInlineSkillSourceParam", "azure.ai.projects.models.LiveServerEvent": "OpenAI.LiveServerEvent", "azure.ai.projects.models.LiveInputAudioAppend": "OpenAI.LiveInputAudioAppend", "azure.ai.projects.models.LiveLiveError": "OpenAI.LiveLiveError", + "azure.ai.projects.models.LiveLocalEnvironmentParam": "OpenAI.LiveLocalEnvironmentParam", + "azure.ai.projects.models.LiveLocalSkillParam": "OpenAI.LiveLocalSkillParam", "azure.ai.projects.models.LiveMCPToolChoiceParam": "OpenAI.LiveMCPToolChoiceParam", + "azure.ai.projects.models.LiveMCPToolInputParam": "OpenAI.LiveMCPToolInputParam", + "azure.ai.projects.models.LiveNamespaceToolInputParam": "OpenAI.LiveNamespaceToolInputParam", "azure.ai.projects.models.LiveOutputAudioDelta": "OpenAI.LiveOutputAudioDelta", + "azure.ai.projects.models.LiveProgrammaticToolInputParam": "OpenAI.LiveProgrammaticToolInputParam", "azure.ai.projects.models.LiveResponsesDelegationParam": "OpenAI.LiveResponsesDelegationParam", "azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam": "OpenAI.LiveResponsesDelegationSettingsInputParam", "azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam": "OpenAI.LiveResponsesDelegationSettingsUpdateInputParam", "azure.ai.projects.models.LiveResponsesDelegationUpdateParam": "OpenAI.LiveResponsesDelegationUpdateParam", "azure.ai.projects.models.LiveServerEventLiveCommentaryAppended": "OpenAI.LiveServerEventLiveCommentaryAppended", + "azure.ai.projects.models.LiveServerEventLiveDecisionEvent": "OpenAI.LiveServerEventLiveDecisionEvent", + "azure.ai.projects.models.LiveServerEventLiveDecisionItemCreated": "OpenAI.LiveServerEventLiveDecisionItemCreated", + "azure.ai.projects.models.LiveServerEventLiveDecisionItemDeleted": "OpenAI.LiveServerEventLiveDecisionItemDeleted", "azure.ai.projects.models.LiveServerEventLiveDelegationCreated": "OpenAI.LiveServerEventLiveDelegationCreated", "azure.ai.projects.models.LiveServerEventLiveErrorEvent": "OpenAI.LiveServerEventLiveErrorEvent", "azure.ai.projects.models.LiveServerEventLiveInfoEvent": "OpenAI.LiveServerEventLiveInfoEvent", @@ -336,6 +374,8 @@ "azure.ai.projects.models.LiveServerEventLiveInputAudioUnmuted": "OpenAI.LiveServerEventLiveInputAudioUnmuted", "azure.ai.projects.models.LiveServerEventLiveInputTranscriptDelta": "OpenAI.LiveServerEventLiveInputTranscriptDelta", "azure.ai.projects.models.LiveServerEventLiveInstructionsAppended": "OpenAI.LiveServerEventLiveInstructionsAppended", + "azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlayed": "OpenAI.LiveServerEventLiveOutputAudioFixturePlayed", + "azure.ai.projects.models.LiveServerEventLiveOutputAudioFixturePlaying": "OpenAI.LiveServerEventLiveOutputAudioFixturePlaying", "azure.ai.projects.models.LiveServerEventLiveOutputTranscriptDelta": "OpenAI.LiveServerEventLiveOutputTranscriptDelta", "azure.ai.projects.models.LiveServerEventLiveResponseEvent": "OpenAI.LiveServerEventLiveResponseEvent", "azure.ai.projects.models.LiveServerEventLiveSessionClosed": "OpenAI.LiveServerEventLiveSessionClosed", @@ -343,6 +383,9 @@ "azure.ai.projects.models.LiveServerEventLiveSessionUpdated": "OpenAI.LiveServerEventLiveSessionUpdated", "azure.ai.projects.models.LiveServerEventLiveSessionUsageUpdated": "OpenAI.LiveServerEventLiveSessionUsageUpdated", "azure.ai.projects.models.LiveServerEventLiveThinkingAppended": "OpenAI.LiveServerEventLiveThinkingAppended", + "azure.ai.projects.models.LiveServerEventLiveTransportAnswered": "OpenAI.LiveServerEventLiveTransportAnswered", + "azure.ai.projects.models.LiveServerEventLiveTransportFailed": "OpenAI.LiveServerEventLiveTransportFailed", + "azure.ai.projects.models.LiveServerEventLiveTransportRinging": "OpenAI.LiveServerEventLiveTransportRinging", "azure.ai.projects.models.LiveSessionAudioFormatPCMAParam": "OpenAI.LiveSessionAudioFormatPCMAParam", "azure.ai.projects.models.LiveSessionAudioFormatPCMParam": "OpenAI.LiveSessionAudioFormatPCMParam", "azure.ai.projects.models.LiveSessionAudioFormatPCMUParam": "OpenAI.LiveSessionAudioFormatPCMUParam", @@ -350,14 +393,22 @@ "azure.ai.projects.models.LiveSessionStartEvent": "OpenAI.LiveSessionStartEvent", "azure.ai.projects.models.LiveSessionUpdateParams": "OpenAI.LiveSessionUpdateParams", "azure.ai.projects.models.LiveSessionUsage": "OpenAI.LiveSessionUsage", - "azure.ai.projects.models.LiveTransportAnswered": "OpenAI.LiveTransportAnswered", + "azure.ai.projects.models.LiveSkillReferenceParam": "OpenAI.LiveSkillReferenceParam", + "azure.ai.projects.models.LiveSpecificApplyPatchParam": "OpenAI.LiveSpecificApplyPatchParam", + "azure.ai.projects.models.LiveSpecificCodeInterpreterParam": "OpenAI.LiveSpecificCodeInterpreterParam", + "azure.ai.projects.models.LiveSpecificComputerParam": "OpenAI.LiveSpecificComputerParam", + "azure.ai.projects.models.LiveSpecificCustomToolParam": "OpenAI.LiveSpecificCustomToolParam", + "azure.ai.projects.models.LiveSpecificFileSearchParam": "OpenAI.LiveSpecificFileSearchParam", + "azure.ai.projects.models.LiveSpecificFunctionShellParam": "OpenAI.LiveSpecificFunctionShellParam", + "azure.ai.projects.models.LiveSpecificImageGenParam": "OpenAI.LiveSpecificImageGenParam", + "azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam": "OpenAI.LiveSpecificProgrammaticToolCallingParam", + "azure.ai.projects.models.LiveSpecificWebSearchParam": "OpenAI.LiveSpecificWebSearchParam", + "azure.ai.projects.models.LiveSpecificWebSearchPreviewParam": "OpenAI.LiveSpecificWebSearchPreviewParam", + "azure.ai.projects.models.LiveToolSearchToolInputParam": "OpenAI.LiveToolSearchToolInputParam", "azure.ai.projects.models.LiveTransportCallError": "OpenAI.LiveTransportCallError", "azure.ai.projects.models.LiveTransportDTMFReceived": "OpenAI.LiveTransportDTMFReceived", "azure.ai.projects.models.LiveTransportDTMFSend": "OpenAI.LiveTransportDTMFSend", - "azure.ai.projects.models.LiveTransportFailed": "OpenAI.LiveTransportFailed", - "azure.ai.projects.models.LiveTransportRinging": "OpenAI.LiveTransportRinging", "azure.ai.projects.models.LiveWebSearchToolInputParam": "OpenAI.LiveWebSearchToolInputParam", - "azure.ai.projects.models.LocalShellToolParam": "OpenAI.LocalShellToolParam", "azure.ai.projects.models.LocalSkillParam": "OpenAI.LocalSkillParam", "azure.ai.projects.models.LogProbProperties": "OpenAI.LogProbProperties", "azure.ai.projects.models.LoraConfig": "Azure.AI.Projects.LoraConfig", @@ -420,11 +471,11 @@ "azure.ai.projects.models.OptimizationContext": "Azure.AI.Projects.OptimizationContext", "azure.ai.projects.models.TelemetryEndpoint": "Azure.AI.Projects.TelemetryEndpoint", "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", + "azure.ai.projects.models.OutputTokensDetailsResource": "OpenAI.OutputTokensDetailsResource", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", "azure.ai.projects.models.PickPropertiesVoiceAgentAudioConfig": "TypeSpec.PickProperties", "azure.ai.projects.models.ProceduralMemoryItem": "Azure.AI.Projects.ProceduralMemoryItem", - "azure.ai.projects.models.ProgrammaticToolCallingParam": "OpenAI.ProgrammaticToolCallingParam", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", "azure.ai.projects.models.PromptBasedEvaluatorDefinition": "Azure.AI.Projects.PromptBasedEvaluatorDefinition", @@ -435,6 +486,10 @@ "azure.ai.projects.models.ProtocolVersionRecord": "Azure.AI.Projects.ProtocolVersionRecord", "azure.ai.projects.models.TelephonyTransferDestination": "Azure.AI.Projects.TelephonyTransferDestination", "azure.ai.projects.models.PSTNTelephonyTransferDestination": "Azure.AI.Projects.PSTNTelephonyTransferDestination", + "azure.ai.projects.models.QuestionParam": "OpenAI.QuestionParam", + "azure.ai.projects.models.QuestionParamChoice": "OpenAI.QuestionParamChoice", + "azure.ai.projects.models.QuestionParamPredicate": "OpenAI.QuestionParamPredicate", + "azure.ai.projects.models.QuestionParamScore": "OpenAI.QuestionParamScore", "azure.ai.projects.models.RaiConfig": "Azure.AI.Projects.RaiConfig", "azure.ai.projects.models.RaiInvocationModeration": "Azure.AI.Projects.RaiInvocationModeration", "azure.ai.projects.models.RaiSseTextSelector": "Azure.AI.Projects.RaiSseTextSelector", @@ -539,6 +594,7 @@ "azure.ai.projects.models.ResponsesProtocolConfiguration": "Azure.AI.Projects.ResponsesProtocolConfiguration", "azure.ai.projects.models.ResponseUsageInputTokensDetails": "OpenAI.ResponseUsageInputTokensDetails", "azure.ai.projects.models.ResponseUsageOutputTokensDetails": "OpenAI.ResponseUsageOutputTokensDetails", + "azure.ai.projects.models.ResponseUsageResource": "OpenAI.ResponseUsageResource", "azure.ai.projects.models.Routine": "Azure.AI.Projects.Routine", "azure.ai.projects.models.RoutineAuthorization": "Azure.AI.Projects.RoutineAuthorization", "azure.ai.projects.models.RoutineRun": "Azure.AI.Projects.RoutineRun", @@ -548,6 +604,8 @@ "azure.ai.projects.models.Schedule": "Azure.AI.Projects.Schedule", "azure.ai.projects.models.ScheduleRoutineTrigger": "Azure.AI.Projects.ScheduleRoutineTrigger", "azure.ai.projects.models.ScheduleRun": "Azure.AI.Projects.ScheduleRun", + "azure.ai.projects.models.ScoreLevelParam": "OpenAI.ScoreLevelParam", + "azure.ai.projects.models.ScoreProbabilityResource": "OpenAI.ScoreProbabilityResource", "azure.ai.projects.models.SessionConfiguration": "Azure.AI.Projects.SessionConfiguration", "azure.ai.projects.models.SessionDirectoryEntry": "Azure.AI.Projects.SessionDirectoryEntry", "azure.ai.projects.models.SessionFileWriteResult": "Azure.AI.Projects.SessionFileWriteResponse", @@ -599,6 +657,7 @@ "azure.ai.projects.models.TextResponseFormatJsonSchema": "OpenAI.TextResponseFormatJsonSchema", "azure.ai.projects.models.TextResponseFormatText": "OpenAI.TextResponseFormatConfigurationResponseFormatText", "azure.ai.projects.models.TimerRoutineTrigger": "Azure.AI.Projects.TimerRoutineTrigger", + "azure.ai.projects.models.ToolApplyPatchToolParam": "OpenAI.ToolApplyPatchToolParam", "azure.ai.projects.models.ToolboxObject": "Azure.AI.Projects.ToolboxObject", "azure.ai.projects.models.ToolboxPolicies": "Azure.AI.Projects.ToolboxPolicies", "azure.ai.projects.models.ToolboxSearchPreviewToolboxTool": "Azure.AI.Projects.ToolboxSearchPreviewToolboxTool", @@ -623,12 +682,25 @@ "azure.ai.projects.models.ToolChoiceMCP": "OpenAI.ToolChoiceMCP", "azure.ai.projects.models.ToolChoiceWebSearchPreview": "OpenAI.ToolChoiceWebSearchPreview", "azure.ai.projects.models.ToolChoiceWebSearchPreview20250311": "OpenAI.ToolChoiceWebSearchPreview20250311", + "azure.ai.projects.models.ToolCodeInterpreterTool": "OpenAI.ToolCodeInterpreterTool", + "azure.ai.projects.models.ToolComputerTool": "OpenAI.ToolComputerTool", + "azure.ai.projects.models.ToolComputerUsePreviewTool": "OpenAI.ToolComputerUsePreviewTool", "azure.ai.projects.models.ToolConfig": "Azure.AI.Projects.ToolConfig", + "azure.ai.projects.models.ToolCustomToolParam": "OpenAI.ToolCustomToolParam", "azure.ai.projects.models.ToolDescription": "Azure.AI.Projects.ToolDescription", + "azure.ai.projects.models.ToolFileSearchTool": "OpenAI.ToolFileSearchTool", + "azure.ai.projects.models.ToolFunctionShellToolParam": "OpenAI.ToolFunctionShellToolParam", + "azure.ai.projects.models.ToolFunctionTool": "OpenAI.ToolFunctionTool", + "azure.ai.projects.models.ToolImageGenTool": "OpenAI.ToolImageGenTool", + "azure.ai.projects.models.ToolLocalShellToolParam": "OpenAI.ToolLocalShellToolParam", + "azure.ai.projects.models.ToolMcpTool": "OpenAI.ToolMcpTool", + "azure.ai.projects.models.ToolProgrammaticToolCallingParam": "OpenAI.ToolProgrammaticToolCallingParam", "azure.ai.projects.models.ToolProjectConnection": "Azure.AI.Projects.ToolProjectConnection", "azure.ai.projects.models.ToolSearchToolboxTool": "Azure.AI.Projects.ToolSearchToolboxTool", - "azure.ai.projects.models.ToolSearchToolParam": "OpenAI.ToolSearchToolParam", + "azure.ai.projects.models.ToolToolSearchToolParam": "OpenAI.ToolToolSearchToolParam", "azure.ai.projects.models.ToolUseFineTuningDataGenerationJobConfiguration": "Azure.AI.Projects.ToolUseFineTuningDataGenerationJobConfiguration", + "azure.ai.projects.models.ToolWebSearchPreviewTool": "OpenAI.ToolWebSearchPreviewTool", + "azure.ai.projects.models.ToolWebSearchTool": "OpenAI.ToolWebSearchTool", "azure.ai.projects.models.TracesDataGenerationJobConfiguration": "Azure.AI.Projects.TracesDataGenerationJobConfiguration", "azure.ai.projects.models.TracesDataGenerationJobSource": "Azure.AI.Projects.TracesDataGenerationJobSource", "azure.ai.projects.models.TracesEvaluatorGenerationJobSource": "Azure.AI.Projects.TracesEvaluatorGenerationJobSource", @@ -723,6 +795,10 @@ "azure.ai.projects.models.VoiceAgentSessionAvatarConfig": "Azure.AI.Projects.VoiceAgentSessionAvatarConfig", "azure.ai.projects.models.VoiceAgentSessionResponseConfig": "Azure.AI.Projects.VoiceAgentSessionResponseConfig", "azure.ai.projects.models.VoiceAgentSessionUpdateConfig": "Azure.AI.Projects.VoiceAgentSessionUpdateConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeConfig": "Azure.AI.Projects.VoiceAgentSoundscapeConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig": "Azure.AI.Projects.VoiceAgentSoundscapeSourceConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig": "Azure.AI.Projects.VoiceAgentSoundscapeTrackConfig", + "azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig": "Azure.AI.Projects.VoiceAgentSoundscapeWorkingTrackConfig", "azure.ai.projects.models.VoiceAgentStaticInterimResponseConfig": "Azure.AI.Projects.VoiceAgentStaticInterimResponseConfig", "azure.ai.projects.models.VoiceAgentSubagent": "Azure.AI.Projects.VoiceAgentSubagent", "azure.ai.projects.models.VoiceAgentSubagentConfig": "Azure.AI.Projects.VoiceAgentSubagentConfig", @@ -745,8 +821,6 @@ "azure.ai.projects.models.WebIQPreviewToolboxTool": "Azure.AI.Projects.WebIQPreviewToolboxTool", "azure.ai.projects.models.WebSearchApproximateLocation": "OpenAI.WebSearchApproximateLocation", "azure.ai.projects.models.WebSearchConfiguration": "Azure.AI.Projects.WebSearchConfiguration", - "azure.ai.projects.models.WebSearchPreviewTool": "OpenAI.WebSearchPreviewTool", - "azure.ai.projects.models.WebSearchTool": "OpenAI.WebSearchTool", "azure.ai.projects.models.WebSearchToolboxTool": "Azure.AI.Projects.WebSearchToolboxTool", "azure.ai.projects.models.WebSearchToolFilters": "OpenAI.WebSearchToolFilters", "azure.ai.projects.models.WeeklyRecurrenceSchedule": "Azure.AI.Projects.WeeklyRecurrenceSchedule", @@ -822,7 +896,6 @@ "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", "azure.ai.projects.models.VoiceAgentSubProtocol": "Azure.AI.Projects.VoiceAgentSubProtocol", - "azure.ai.projects.models.VoiceAgentProfanityFilterMode": "Azure.AI.Projects.VoiceAgentProfanityFilterMode", "azure.ai.projects.models.AgentVersionStatus": "Azure.AI.Projects.AgentVersionStatus", "azure.ai.projects.models.AgentIdentityStatus": "Azure.AI.Projects.AgentIdentityStatus", "azure.ai.projects.models.AgentBlueprintReferenceType": "Azure.AI.Projects.AgentBlueprintReferenceType", @@ -918,7 +991,9 @@ "azure.ai.projects.models.VoiceAgentEndOfUtteranceThresholdLevel": "Azure.AI.Projects.VoiceAgentEndOfUtteranceThresholdLevel", "azure.ai.projects.models.VoiceAgentEchoCancellationReferenceSource": "Azure.AI.Projects.VoiceAgentEchoCancellationReferenceSource", "azure.ai.projects.models.VoiceAgentInputTranscriptionModel": "Azure.AI.Projects.VoiceAgentInputTranscriptionModel", + "azure.ai.projects.models.VoiceAgentProfanityFilterMode": "Azure.AI.Projects.VoiceAgentProfanityFilterMode", "azure.ai.projects.models.VoiceAgentAudioTimestampType": "Azure.AI.Projects.VoiceAgentAudioTimestampType", + "azure.ai.projects.models.VoiceAgentSoundscapeSound": "Azure.AI.Projects.VoiceAgentSoundscapeSound", "azure.ai.projects.models.VoiceOutputModality": "Azure.AI.Projects.VoiceOutputModality", "azure.ai.projects.models.VoiceAgentSessionIncludeOption": "Azure.AI.Projects.VoiceAgentSessionIncludeOption", "azure.ai.projects.models.VoiceAgentInterimResponseTrigger": "Azure.AI.Projects.VoiceAgentInterimResponseTrigger", @@ -930,7 +1005,9 @@ "azure.ai.projects.models.LiveReasoningEffort": "OpenAI.LiveReasoningEffort", "azure.ai.projects.models.LiveReasoningSummary": "OpenAI.LiveReasoningSummary", "azure.ai.projects.models.LiveTextVerbosity": "OpenAI.LiveTextVerbosity", + "azure.ai.projects.models.LiveContainerMemoryLimit": "OpenAI.LiveContainerMemoryLimit", "azure.ai.projects.models.LiveToolChoiceEnum": "OpenAI.LiveToolChoiceEnum", + "azure.ai.projects.models.LiveToolChoiceValueEnum": "OpenAI.LiveToolChoiceValueEnum", "azure.ai.projects.models.VoiceAgentAnimationOutputType": "Azure.AI.Projects.VoiceAgentAnimationOutputType", "azure.ai.projects.models.RealtimeReasoningEffort": "OpenAI.RealtimeReasoningEffort", "azure.ai.projects.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", @@ -939,10 +1016,13 @@ "azure.ai.projects.models.CreateTranscriptionResponseJsonUsageType": "OpenAI.CreateTranscriptionResponseJsonUsageType", "azure.ai.projects.models.VoiceAgentSubagentAbortReason": "Azure.AI.Projects.VoiceAgentSubagentAbortReason", "azure.ai.projects.models.LiveClientEventType": "OpenAI.LiveClientEventType", + "azure.ai.projects.models.LiveDetailEnum": "OpenAI.LiveDetailEnum", "azure.ai.projects.models.ModelIdsLive": "OpenAI.ModelIdsLive", "azure.ai.projects.models.LiveInitialItemType": "OpenAI.LiveInitialItemType", "azure.ai.projects.models.LiveInitialMessageStatus": "OpenAI.LiveInitialMessageStatus", + "azure.ai.projects.models.QuestionParamType": "OpenAI.QuestionParamType", "azure.ai.projects.models.LiveServerEventType": "OpenAI.LiveServerEventType", + "azure.ai.projects.models.AnswerResourceType": "OpenAI.AnswerResourceType", "azure.ai.projects.models.VoiceAgentTransport": "Azure.AI.Projects.VoiceAgentTransport", "azure.ai.projects.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", "azure.ai.projects.aio.operations.AgentsOperations.get": "Azure.AI.Projects.Agents.getAgent", @@ -1101,5 +1181,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "3c64f94d6c46" + "CrossLanguageVersion": "9bc200aa5497" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py index da3be90e6ce6..4050981e8cb9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -26,4 +26,6 @@ ] VoiceAgentSessionUpdate: TypeAlias = "_models.VoiceAgentSessionUpdateConfig" VoiceAgentSessionResponse: TypeAlias = "_models.VoiceAgentSessionResponseConfig" +ChoiceValueParam: TypeAlias = Union[str, bool] +ChoiceValueResource: TypeAlias = Union[str, bool] GenerateAgentRequest: TypeAlias = "_models.GenerateVoiceAgentRequest" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index ee2034363bfe..54d26565fd6b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -103,10 +103,14 @@ AgentTaxonomyInput, AgentVersionDetails, AgenticIdentityPreviewCredentials, + AnswerResource, + AnswerResourceChoice, + AnswerResourcePredicate, + AnswerResourceRefusal, + AnswerResourceScore, ApiError, ApiErrorResponse, ApiKeyCredentials, - ApplyPatchToolParam, ApproximateLocation, ArtifactProfile, AutoCodeInterpreterToolParam, @@ -144,16 +148,15 @@ ChartCoordinate, ChatCompletionTool, ChatSummaryMemoryItem, + ChoiceOptionParam, + ChoiceProbabilityResource, ClusterInsightResult, ClusterTokenUsage, CodeBasedEvaluatorDefinition, CodeConfiguration, - CodeInterpreterTool, CodeInterpreterToolboxTool, ComparisonFilter, CompoundFilter, - ComputerTool, - ComputerUsePreviewTool, Connection, ContainerAutoParam, ContainerConfiguration, @@ -192,6 +195,7 @@ DatasetEvaluatorGenerationJobSource, DatasetReference, DatasetVersion, + DecisionResponse, Delegation, DeleteAgentResponse, DeleteAgentVersionResponse, @@ -246,18 +250,15 @@ FileDataGenerationJobOutput, FileDataGenerationJobSource, FileDatasetVersion, - FileSearchTool, FileSearchToolboxTool, FixedRatioVersionSelectionRule, FolderDatasetVersion, FoundryModelWarning, FunctionObject, FunctionParameters, - FunctionShellToolParam, FunctionShellToolParamEnvironment, FunctionShellToolParamEnvironmentContainerReferenceParam, FunctionShellToolParamEnvironmentLocalEnvironmentParam, - FunctionTool, FunctionToolParam, GenerateVoiceAgentRequest, GitHubCopilotHarness, @@ -270,11 +271,11 @@ HourlyRecurrenceSchedule, HumanEvaluationPreviewRuleAction, HybridSearchOptions, - ImageGenTool, ImageGenToolInputImageMask, Index, InlineSkillParam, InlineSkillSourceParam, + InputTokensDetailsResource, Insight, InsightCluster, InsightModelConfiguration, @@ -291,27 +292,54 @@ InvokeAgentResponsesApiDispatchPayload, InvokeAgentResponsesApiRoutineAction, LiveAllowedServerEventParam, + LiveAllowedToolsChoiceParam, + LiveApplyPatchToolInputParam, LiveAudioFormat, LiveClientConfigParam, LiveClientDelegationParam, LiveClientEvent, LiveClientEventLiveCommentaryAppendParam, + LiveClientEventLiveDecisionCreateParam, + LiveClientEventLiveDecisionItemCreateParam, + LiveClientEventLiveDecisionItemDeleteParam, LiveClientEventLiveInputAudioAppendEvent, LiveClientEventLiveInputAudioMuteParam, LiveClientEventLiveInputAudioUnmuteParam, LiveClientEventLiveInstructionsAppendParam, + LiveClientEventLiveOutputAudioFixturePlayParam, LiveClientEventLiveResponseCreateParam, LiveClientEventLiveResponseItemCreateParam, LiveClientEventLiveSessionCloseParam, LiveClientEventLiveSessionUpdateParam, LiveClientEventLiveThinkingAppendParam, + LiveCodeInterpreterToolInputParam, + LiveComputerToolInputParam, + LiveContainerNetworkPolicyDisabledParam, + LiveContainerReferenceParam, LiveContextWindowUsage, + LiveCustomToolInputParam, LiveCustomVoiceParam, LiveDataChannelConfigParam, + LiveDecisionCompleted, + LiveDecisionInputImageParam, + LiveDecisionInputItemParam, + LiveDecisionInputTextParam, + LiveDecisionQuestionsInputParam_2, + LiveDecisionStoredInputItemParam, + LiveDecisionTriggerInputParam_2, + LiveDecisionsDelegationParam_2, + LiveDecisionsDelegationUpdateParam, + LiveDecisionsSettingsInputParam_2, + LiveDecisionsSettingsUpdateParam, LiveDelegationReasoningInputParam, LiveDelegationTextInputParam, + LiveFileSearchToolInputParam, LiveFunctionToolChoiceParam, LiveFunctionToolInputParam, + LiveHostedShellContainerAutoParam, + LiveHostedShellNetworkPolicyAllowlistParam, + LiveHostedShellToolInputParam, + LiveImageGenerationToolInputParam, LiveInitialAssistantMessageItemParam, LiveInitialDeveloperMessageItemParam, LiveInitialInputTextContentPartParam, @@ -321,16 +349,26 @@ LiveInitialSessionAudioParam, LiveInitialTextContentPartParam, LiveInitialUserMessageItemParam, + LiveInlineSkillParam, + LiveInlineSkillSourceParam, LiveInputAudioAppend, LiveLiveError, + LiveLocalEnvironmentParam, + LiveLocalSkillParam, LiveMCPToolChoiceParam, + LiveMCPToolInputParam, + LiveNamespaceToolInputParam, LiveOutputAudioDelta, + LiveProgrammaticToolInputParam, LiveResponsesDelegationParam, LiveResponsesDelegationSettingsInputParam, LiveResponsesDelegationSettingsUpdateInputParam, LiveResponsesDelegationUpdateParam, LiveServerEvent, LiveServerEventLiveCommentaryAppended, + LiveServerEventLiveDecisionEvent, + LiveServerEventLiveDecisionItemCreated, + LiveServerEventLiveDecisionItemDeleted, LiveServerEventLiveDelegationCreated, LiveServerEventLiveErrorEvent, LiveServerEventLiveInfoEvent, @@ -338,6 +376,8 @@ LiveServerEventLiveInputAudioUnmuted, LiveServerEventLiveInputTranscriptDelta, LiveServerEventLiveInstructionsAppended, + LiveServerEventLiveOutputAudioFixturePlayed, + LiveServerEventLiveOutputAudioFixturePlaying, LiveServerEventLiveOutputTranscriptDelta, LiveServerEventLiveResponseEvent, LiveServerEventLiveSessionClosed, @@ -345,6 +385,9 @@ LiveServerEventLiveSessionUpdated, LiveServerEventLiveSessionUsageUpdated, LiveServerEventLiveThinkingAppended, + LiveServerEventLiveTransportAnswered, + LiveServerEventLiveTransportFailed, + LiveServerEventLiveTransportRinging, LiveSessionAudioFormatPCMAParam, LiveSessionAudioFormatPCMParam, LiveSessionAudioFormatPCMUParam, @@ -352,14 +395,22 @@ LiveSessionStartEvent, LiveSessionUpdateParams, LiveSessionUsage, - LiveTransportAnswered, + LiveSkillReferenceParam, + LiveSpecificApplyPatchParam, + LiveSpecificCodeInterpreterParam, + LiveSpecificComputerParam, + LiveSpecificCustomToolParam, + LiveSpecificFileSearchParam, + LiveSpecificFunctionShellParam, + LiveSpecificImageGenParam, + LiveSpecificProgrammaticToolCallingParam, + LiveSpecificWebSearchParam, + LiveSpecificWebSearchPreviewParam, + LiveToolSearchToolInputParam, LiveTransportCallError, LiveTransportDTMFReceived, LiveTransportDTMFSend, - LiveTransportFailed, - LiveTransportRinging, LiveWebSearchToolInputParam, - LocalShellToolParam, LocalSkillParam, LogProbProperties, LoraConfig, @@ -422,12 +473,12 @@ OpenApiToolboxTool, OptimizationContext, OtlpTelemetryEndpoint, + OutputTokensDetailsResource, PSTNTelephonyTransferDestination, PendingUploadRequest, PendingUploadResponse, PickPropertiesVoiceAgentAudioConfig, ProceduralMemoryItem, - ProgrammaticToolCallingParam, PromptAgentDefinition, PromptAgentDefinitionTextOptions, PromptBasedEvaluatorDefinition, @@ -436,6 +487,10 @@ PromptOptimizationConfiguration, ProtocolConfiguration, ProtocolVersionRecord, + QuestionParam, + QuestionParamChoice, + QuestionParamPredicate, + QuestionParamScore, RaiConfig, RaiInvocationModeration, RaiSseTextSelector, @@ -541,6 +596,7 @@ ReminderPreviewToolboxTool, ResponseUsageInputTokensDetails, ResponseUsageOutputTokensDetails, + ResponseUsageResource, ResponsesProtocolConfiguration, Routine, RoutineAction, @@ -555,6 +611,8 @@ ScheduleRoutineTrigger, ScheduleRun, ScheduleTask, + ScoreLevelParam, + ScoreProbabilityResource, SessionConfiguration, SessionDirectoryEntry, SessionFileWriteResult, @@ -609,6 +667,7 @@ TextResponseFormatText, TimerRoutineTrigger, Tool, + ToolApplyPatchToolParam, ToolChoiceAllowed, ToolChoiceCodeInterpreter, ToolChoiceComputer, @@ -622,12 +681,25 @@ ToolChoiceParam, ToolChoiceWebSearchPreview, ToolChoiceWebSearchPreview20250311, + ToolCodeInterpreterTool, + ToolComputerTool, + ToolComputerUsePreviewTool, ToolConfig, + ToolCustomToolParam, ToolDescription, + ToolFileSearchTool, + ToolFunctionShellToolParam, + ToolFunctionTool, + ToolImageGenTool, + ToolLocalShellToolParam, + ToolMcpTool, + ToolProgrammaticToolCallingParam, ToolProjectConnection, - ToolSearchToolParam, ToolSearchToolboxTool, + ToolToolSearchToolParam, ToolUseFineTuningDataGenerationJobConfiguration, + ToolWebSearchPreviewTool, + ToolWebSearchTool, ToolboxObject, ToolboxPolicies, ToolboxSearchPreviewToolboxTool, @@ -734,6 +806,10 @@ VoiceAgentSessionAvatarConfig, VoiceAgentSessionResponseConfig, VoiceAgentSessionUpdateConfig, + VoiceAgentSoundscapeConfig, + VoiceAgentSoundscapeSourceConfig, + VoiceAgentSoundscapeTrackConfig, + VoiceAgentSoundscapeWorkingTrackConfig, VoiceAgentStaticInterimResponseConfig, VoiceAgentSubagent, VoiceAgentSubagentConfig, @@ -759,8 +835,6 @@ WebIQPreviewToolboxTool, WebSearchApproximateLocation, WebSearchConfiguration, - WebSearchPreviewTool, - WebSearchTool, WebSearchToolFilters, WebSearchToolboxTool, WeeklyRecurrenceSchedule, @@ -797,6 +871,7 @@ AgentState, AgentStateSource, AgentVersionStatus, + AnswerResourceType, AttackStrategy, AzureAISearchQueryType, CallableToolAllowedCaller, @@ -846,6 +921,8 @@ JobStatus, LiveAudioFormatType, LiveClientEventType, + LiveContainerMemoryLimit, + LiveDetailEnum, LiveInitialItemType, LiveInitialMessageStatus, LiveReasoningEffort, @@ -854,6 +931,7 @@ LiveServerEventType, LiveTextVerbosity, LiveToolChoiceEnum, + LiveToolChoiceValueEnum, MemoryItemKind, MemoryOperationKind, MemoryStoreKind, @@ -869,6 +947,7 @@ PageOrder, PendingUploadType, PublishApprovalStatus, + QuestionParamType, RaiInvocationContentType, RaiInvocationMode, RankerVersionType, @@ -948,6 +1027,7 @@ VoiceAgentNoiseReductionType, VoiceAgentProfanityFilterMode, VoiceAgentSessionIncludeOption, + VoiceAgentSoundscapeSound, VoiceAgentSubProtocol, VoiceAgentSubagentAbortReason, VoiceAgentSystemToolName, @@ -1055,10 +1135,14 @@ "AgentTaxonomyInput", "AgentVersionDetails", "AgenticIdentityPreviewCredentials", + "AnswerResource", + "AnswerResourceChoice", + "AnswerResourcePredicate", + "AnswerResourceRefusal", + "AnswerResourceScore", "ApiError", "ApiErrorResponse", "ApiKeyCredentials", - "ApplyPatchToolParam", "ApproximateLocation", "ArtifactProfile", "AutoCodeInterpreterToolParam", @@ -1096,16 +1180,15 @@ "ChartCoordinate", "ChatCompletionTool", "ChatSummaryMemoryItem", + "ChoiceOptionParam", + "ChoiceProbabilityResource", "ClusterInsightResult", "ClusterTokenUsage", "CodeBasedEvaluatorDefinition", "CodeConfiguration", - "CodeInterpreterTool", "CodeInterpreterToolboxTool", "ComparisonFilter", "CompoundFilter", - "ComputerTool", - "ComputerUsePreviewTool", "Connection", "ContainerAutoParam", "ContainerConfiguration", @@ -1144,6 +1227,7 @@ "DatasetEvaluatorGenerationJobSource", "DatasetReference", "DatasetVersion", + "DecisionResponse", "Delegation", "DeleteAgentResponse", "DeleteAgentVersionResponse", @@ -1198,18 +1282,15 @@ "FileDataGenerationJobOutput", "FileDataGenerationJobSource", "FileDatasetVersion", - "FileSearchTool", "FileSearchToolboxTool", "FixedRatioVersionSelectionRule", "FolderDatasetVersion", "FoundryModelWarning", "FunctionObject", "FunctionParameters", - "FunctionShellToolParam", "FunctionShellToolParamEnvironment", "FunctionShellToolParamEnvironmentContainerReferenceParam", "FunctionShellToolParamEnvironmentLocalEnvironmentParam", - "FunctionTool", "FunctionToolParam", "GenerateVoiceAgentRequest", "GitHubCopilotHarness", @@ -1222,11 +1303,11 @@ "HourlyRecurrenceSchedule", "HumanEvaluationPreviewRuleAction", "HybridSearchOptions", - "ImageGenTool", "ImageGenToolInputImageMask", "Index", "InlineSkillParam", "InlineSkillSourceParam", + "InputTokensDetailsResource", "Insight", "InsightCluster", "InsightModelConfiguration", @@ -1243,27 +1324,54 @@ "InvokeAgentResponsesApiDispatchPayload", "InvokeAgentResponsesApiRoutineAction", "LiveAllowedServerEventParam", + "LiveAllowedToolsChoiceParam", + "LiveApplyPatchToolInputParam", "LiveAudioFormat", "LiveClientConfigParam", "LiveClientDelegationParam", "LiveClientEvent", "LiveClientEventLiveCommentaryAppendParam", + "LiveClientEventLiveDecisionCreateParam", + "LiveClientEventLiveDecisionItemCreateParam", + "LiveClientEventLiveDecisionItemDeleteParam", "LiveClientEventLiveInputAudioAppendEvent", "LiveClientEventLiveInputAudioMuteParam", "LiveClientEventLiveInputAudioUnmuteParam", "LiveClientEventLiveInstructionsAppendParam", + "LiveClientEventLiveOutputAudioFixturePlayParam", "LiveClientEventLiveResponseCreateParam", "LiveClientEventLiveResponseItemCreateParam", "LiveClientEventLiveSessionCloseParam", "LiveClientEventLiveSessionUpdateParam", "LiveClientEventLiveThinkingAppendParam", + "LiveCodeInterpreterToolInputParam", + "LiveComputerToolInputParam", + "LiveContainerNetworkPolicyDisabledParam", + "LiveContainerReferenceParam", "LiveContextWindowUsage", + "LiveCustomToolInputParam", "LiveCustomVoiceParam", "LiveDataChannelConfigParam", + "LiveDecisionCompleted", + "LiveDecisionInputImageParam", + "LiveDecisionInputItemParam", + "LiveDecisionInputTextParam", + "LiveDecisionQuestionsInputParam_2", + "LiveDecisionStoredInputItemParam", + "LiveDecisionTriggerInputParam_2", + "LiveDecisionsDelegationParam_2", + "LiveDecisionsDelegationUpdateParam", + "LiveDecisionsSettingsInputParam_2", + "LiveDecisionsSettingsUpdateParam", "LiveDelegationReasoningInputParam", "LiveDelegationTextInputParam", + "LiveFileSearchToolInputParam", "LiveFunctionToolChoiceParam", "LiveFunctionToolInputParam", + "LiveHostedShellContainerAutoParam", + "LiveHostedShellNetworkPolicyAllowlistParam", + "LiveHostedShellToolInputParam", + "LiveImageGenerationToolInputParam", "LiveInitialAssistantMessageItemParam", "LiveInitialDeveloperMessageItemParam", "LiveInitialInputTextContentPartParam", @@ -1273,16 +1381,26 @@ "LiveInitialSessionAudioParam", "LiveInitialTextContentPartParam", "LiveInitialUserMessageItemParam", + "LiveInlineSkillParam", + "LiveInlineSkillSourceParam", "LiveInputAudioAppend", "LiveLiveError", + "LiveLocalEnvironmentParam", + "LiveLocalSkillParam", "LiveMCPToolChoiceParam", + "LiveMCPToolInputParam", + "LiveNamespaceToolInputParam", "LiveOutputAudioDelta", + "LiveProgrammaticToolInputParam", "LiveResponsesDelegationParam", "LiveResponsesDelegationSettingsInputParam", "LiveResponsesDelegationSettingsUpdateInputParam", "LiveResponsesDelegationUpdateParam", "LiveServerEvent", "LiveServerEventLiveCommentaryAppended", + "LiveServerEventLiveDecisionEvent", + "LiveServerEventLiveDecisionItemCreated", + "LiveServerEventLiveDecisionItemDeleted", "LiveServerEventLiveDelegationCreated", "LiveServerEventLiveErrorEvent", "LiveServerEventLiveInfoEvent", @@ -1290,6 +1408,8 @@ "LiveServerEventLiveInputAudioUnmuted", "LiveServerEventLiveInputTranscriptDelta", "LiveServerEventLiveInstructionsAppended", + "LiveServerEventLiveOutputAudioFixturePlayed", + "LiveServerEventLiveOutputAudioFixturePlaying", "LiveServerEventLiveOutputTranscriptDelta", "LiveServerEventLiveResponseEvent", "LiveServerEventLiveSessionClosed", @@ -1297,6 +1417,9 @@ "LiveServerEventLiveSessionUpdated", "LiveServerEventLiveSessionUsageUpdated", "LiveServerEventLiveThinkingAppended", + "LiveServerEventLiveTransportAnswered", + "LiveServerEventLiveTransportFailed", + "LiveServerEventLiveTransportRinging", "LiveSessionAudioFormatPCMAParam", "LiveSessionAudioFormatPCMParam", "LiveSessionAudioFormatPCMUParam", @@ -1304,14 +1427,22 @@ "LiveSessionStartEvent", "LiveSessionUpdateParams", "LiveSessionUsage", - "LiveTransportAnswered", + "LiveSkillReferenceParam", + "LiveSpecificApplyPatchParam", + "LiveSpecificCodeInterpreterParam", + "LiveSpecificComputerParam", + "LiveSpecificCustomToolParam", + "LiveSpecificFileSearchParam", + "LiveSpecificFunctionShellParam", + "LiveSpecificImageGenParam", + "LiveSpecificProgrammaticToolCallingParam", + "LiveSpecificWebSearchParam", + "LiveSpecificWebSearchPreviewParam", + "LiveToolSearchToolInputParam", "LiveTransportCallError", "LiveTransportDTMFReceived", "LiveTransportDTMFSend", - "LiveTransportFailed", - "LiveTransportRinging", "LiveWebSearchToolInputParam", - "LocalShellToolParam", "LocalSkillParam", "LogProbProperties", "LoraConfig", @@ -1374,12 +1505,12 @@ "OpenApiToolboxTool", "OptimizationContext", "OtlpTelemetryEndpoint", + "OutputTokensDetailsResource", "PSTNTelephonyTransferDestination", "PendingUploadRequest", "PendingUploadResponse", "PickPropertiesVoiceAgentAudioConfig", "ProceduralMemoryItem", - "ProgrammaticToolCallingParam", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", "PromptBasedEvaluatorDefinition", @@ -1388,6 +1519,10 @@ "PromptOptimizationConfiguration", "ProtocolConfiguration", "ProtocolVersionRecord", + "QuestionParam", + "QuestionParamChoice", + "QuestionParamPredicate", + "QuestionParamScore", "RaiConfig", "RaiInvocationModeration", "RaiSseTextSelector", @@ -1493,6 +1628,7 @@ "ReminderPreviewToolboxTool", "ResponseUsageInputTokensDetails", "ResponseUsageOutputTokensDetails", + "ResponseUsageResource", "ResponsesProtocolConfiguration", "Routine", "RoutineAction", @@ -1507,6 +1643,8 @@ "ScheduleRoutineTrigger", "ScheduleRun", "ScheduleTask", + "ScoreLevelParam", + "ScoreProbabilityResource", "SessionConfiguration", "SessionDirectoryEntry", "SessionFileWriteResult", @@ -1561,6 +1699,7 @@ "TextResponseFormatText", "TimerRoutineTrigger", "Tool", + "ToolApplyPatchToolParam", "ToolChoiceAllowed", "ToolChoiceCodeInterpreter", "ToolChoiceComputer", @@ -1574,12 +1713,25 @@ "ToolChoiceParam", "ToolChoiceWebSearchPreview", "ToolChoiceWebSearchPreview20250311", + "ToolCodeInterpreterTool", + "ToolComputerTool", + "ToolComputerUsePreviewTool", "ToolConfig", + "ToolCustomToolParam", "ToolDescription", + "ToolFileSearchTool", + "ToolFunctionShellToolParam", + "ToolFunctionTool", + "ToolImageGenTool", + "ToolLocalShellToolParam", + "ToolMcpTool", + "ToolProgrammaticToolCallingParam", "ToolProjectConnection", - "ToolSearchToolParam", "ToolSearchToolboxTool", + "ToolToolSearchToolParam", "ToolUseFineTuningDataGenerationJobConfiguration", + "ToolWebSearchPreviewTool", + "ToolWebSearchTool", "ToolboxObject", "ToolboxPolicies", "ToolboxSearchPreviewToolboxTool", @@ -1686,6 +1838,10 @@ "VoiceAgentSessionAvatarConfig", "VoiceAgentSessionResponseConfig", "VoiceAgentSessionUpdateConfig", + "VoiceAgentSoundscapeConfig", + "VoiceAgentSoundscapeSourceConfig", + "VoiceAgentSoundscapeTrackConfig", + "VoiceAgentSoundscapeWorkingTrackConfig", "VoiceAgentStaticInterimResponseConfig", "VoiceAgentSubagent", "VoiceAgentSubagentConfig", @@ -1711,8 +1867,6 @@ "WebIQPreviewToolboxTool", "WebSearchApproximateLocation", "WebSearchConfiguration", - "WebSearchPreviewTool", - "WebSearchTool", "WebSearchToolFilters", "WebSearchToolboxTool", "WeeklyRecurrenceSchedule", @@ -1746,6 +1900,7 @@ "AgentState", "AgentStateSource", "AgentVersionStatus", + "AnswerResourceType", "AttackStrategy", "AzureAISearchQueryType", "CallableToolAllowedCaller", @@ -1795,6 +1950,8 @@ "JobStatus", "LiveAudioFormatType", "LiveClientEventType", + "LiveContainerMemoryLimit", + "LiveDetailEnum", "LiveInitialItemType", "LiveInitialMessageStatus", "LiveReasoningEffort", @@ -1803,6 +1960,7 @@ "LiveServerEventType", "LiveTextVerbosity", "LiveToolChoiceEnum", + "LiveToolChoiceValueEnum", "MemoryItemKind", "MemoryOperationKind", "MemoryStoreKind", @@ -1818,6 +1976,7 @@ "PageOrder", "PendingUploadType", "PublishApprovalStatus", + "QuestionParamType", "RaiInvocationContentType", "RaiInvocationMode", "RankerVersionType", @@ -1897,6 +2056,7 @@ "VoiceAgentNoiseReductionType", "VoiceAgentProfanityFilterMode", "VoiceAgentSessionIncludeOption", + "VoiceAgentSoundscapeSound", "VoiceAgentSubProtocol", "VoiceAgentSubagentAbortReason", "VoiceAgentSystemToolName", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 747e202f0fbe..85c7357aca33 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -146,6 +146,9 @@ class AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """VOICE.""" INVOCATIONS_WS = "invocations_ws" """WebSocket-based protocol for hosted voice and real-time streaming agents.""" + VOICE_CONVERSATION_ENGINE = "voice_conversation_engine" + """Text conversation protocol for a hosted agent used by Voice Live Bridge. Declare version + ``1.0.0``; audio transport remains outside this protocol.""" class AgentIdentityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -396,6 +399,19 @@ class AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The agent version has been deleted.""" +class AnswerResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of AnswerResourceType.""" + + PREDICATE = "predicate" + """PREDICATE.""" + CHOICE = "choice" + """CHOICE.""" + SCORE = "score" + """SCORE.""" + REFUSAL = "refusal" + """REFUSAL.""" + + class AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Strategies for attacks.""" @@ -970,9 +986,9 @@ class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Control how much effort the model will exert to match the style and features, especially facial - features, of input images. This parameter is only supported for ``gpt-image-1`` and - ``gpt-image-1.5`` and later models, unsupported for ``gpt-image-1-mini``. Supports ``high`` and - ``low``. Defaults to ``low``. + features, of input images. Supports ``high`` and ``low`` on ``gpt-image-1`` and + ``gpt-image-1.5``; ``gpt-image-1-mini`` supports only ``low``. For ``gpt-image-2``, omit this + parameter. Defaults to ``low`` on supported models. """ HIGH = "high" @@ -1031,12 +1047,20 @@ class LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SESSION_INPUT_AUDIO_MUTE.""" SESSION_INPUT_AUDIO_UNMUTE = "session.input_audio.unmute" """SESSION_INPUT_AUDIO_UNMUTE.""" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAY = "session.output_audio.fixture.play" + """SESSION_OUTPUT_AUDIO_FIXTURE_PLAY.""" SESSION_INSTRUCTIONS_APPEND = "session.instructions.append" """SESSION_INSTRUCTIONS_APPEND.""" SESSION_THINKING_APPEND = "session.thinking.append" """SESSION_THINKING_APPEND.""" SESSION_COMMENTARY_APPEND = "session.commentary.append" """SESSION_COMMENTARY_APPEND.""" + DECISION_CREATE = "decision.create" + """DECISION_CREATE.""" + DECISION_ITEM_CREATE = "decision.item.create" + """DECISION_ITEM_CREATE.""" + DECISION_ITEM_DELETE = "decision.item.delete" + """DECISION_ITEM_DELETE.""" RESPONSE_ITEM_CREATE = "response.item.create" """RESPONSE_ITEM_CREATE.""" RESPONSE_CREATE = "response.create" @@ -1045,6 +1069,32 @@ class LiveClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SESSION_CLOSE.""" +class LiveContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveContainerMemoryLimit.""" + + ENUM_1_G = "1g" + """1_G.""" + ENUM_4_G = "4g" + """4_G.""" + ENUM_16_G = "16g" + """16_G.""" + ENUM_64_G = "64g" + """64_G.""" + + +class LiveDetailEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveDetailEnum.""" + + LOW = "low" + """LOW.""" + HIGH = "high" + """HIGH.""" + AUTO = "auto" + """AUTO.""" + ORIGINAL = "original" + """ORIGINAL.""" + + class LiveInitialItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of LiveInitialItemType.""" @@ -1121,6 +1171,10 @@ class LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SESSION_INPUT_AUDIO_MUTED.""" SESSION_INPUT_AUDIO_UNMUTED = "session.input_audio.unmuted" """SESSION_INPUT_AUDIO_UNMUTED.""" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING = "session.output_audio.fixture.playing" + """SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING.""" + SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED = "session.output_audio.fixture.played" + """SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED.""" SESSION_INSTRUCTIONS_APPENDED = "session.instructions.appended" """SESSION_INSTRUCTIONS_APPENDED.""" SESSION_THINKING_APPENDED = "session.thinking.appended" @@ -1137,6 +1191,12 @@ class LiveServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SESSION_OUTPUT_TRANSCRIPT_DELTA.""" SESSION_DELEGATION_CREATED = "session.delegation.created" """SESSION_DELEGATION_CREATED.""" + DECISION_EVENT = "decision.event" + """DECISION_EVENT.""" + DECISION_ITEM_CREATED = "decision.item.created" + """DECISION_ITEM_CREATED.""" + DECISION_ITEM_DELETED = "decision.item.deleted" + """DECISION_ITEM_DELETED.""" RESPONSE_EVENT = "response.event" """RESPONSE_EVENT.""" SESSION_USAGE_UPDATED = "session.usage.updated" @@ -1181,6 +1241,17 @@ class LiveToolChoiceEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """REQUIRED.""" +class LiveToolChoiceValueEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LiveToolChoiceValueEnum.""" + + NONE = "none" + """NONE.""" + AUTO = "auto" + """AUTO.""" + REQUIRED = "required" + """REQUIRED.""" + + class MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Memory item kind.""" @@ -1363,6 +1434,17 @@ class PublishApprovalStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): tenant-scoped titles are reviewed.""" +class QuestionParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of QuestionParamType.""" + + PREDICATE = "predicate" + """PREDICATE.""" + CHOICE = "choice" + """CHOICE.""" + SCORE = "score" + """SCORE.""" + + class RaiInvocationContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """How an invocations request/response body is parsed to locate text for content-safety moderation. @@ -2658,7 +2740,10 @@ class VoiceAgentEndOfUtteranceThresholdLevel(str, Enum, metaclass=CaseInsensitiv class VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The input-audio transcription model identifier. This is a model name, not a Foundry deployment name. Mirrors the transcription models supported by the managed voice backend, covering the - OpenAI Realtime transcription models plus the Azure and MAI models. Additional values may be + OpenAI Realtime transcription models plus the Azure and MAI models. ``azure-speech-streaming`` + is supported for cascaded text-model conversations only (not realtime speech-to-speech models), + requires a nonempty ``language`` such as ``en-US`` (comma-separated locales are supported), and + supports ``custom_speech``, ``phrase_list``, and ``profanity_filter``. Additional values may be added over time. """ @@ -2680,6 +2765,11 @@ class VoiceAgentInputTranscriptionModel(str, Enum, metaclass=CaseInsensitiveEnum """MAI transcription.""" AZURE_SPEECH = "azure-speech" """Azure AI Speech to text.""" + AZURE_SPEECH_STREAMING = "azure-speech-streaming" + """Azure AI Speech streaming transcription for cascaded text-model conversations only. Requires a + nonempty ``language``, such as ``en-US``; comma-separated locales are supported. Supports + ``custom_speech``, ``phrase_list``, and ``profanity_filter``. Not supported with realtime + speech-to-speech models.""" class VoiceAgentInterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2729,7 +2819,15 @@ class VoiceAgentLiveDelegationTarget(str, Enum, metaclass=CaseInsensitiveEnumMet class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The input audio noise reduction mode.""" + """The input audio noise reduction mode. + + * `azure_deep_noise_suppression_headset`: Azure headset-optimized noise suppression for local voice activity + detection. Optimized for low-sample-rate audio, including 8 kHz telephony audio. Enhances detection audio without + changing the audio used for recognition. The mode is not restricted to headset devices. + * `azure_personal_noise_suppression`: Azure personalized noise suppression for local voice activity detection. + Starts with headset suppression and personalizes detection after automatic speaker enrollment. Recognition audio + is unchanged; headset suppression remains active when personalization is unavailable. + """ NEAR_FIELD = "near_field" """NEAR_FIELD.""" @@ -2737,6 +2835,14 @@ class VoiceAgentNoiseReductionType(str, Enum, metaclass=CaseInsensitiveEnumMeta) """FAR_FIELD.""" AZURE_DEEP_NOISE_SUPPRESSION = "azure_deep_noise_suppression" """Azure deep noise suppression.""" + AZURE_DEEP_NOISE_SUPPRESSION_HEADSET = "azure_deep_noise_suppression_headset" + """Azure headset-optimized noise suppression for local voice activity detection. Optimized for + low-sample-rate audio, including 8 kHz telephony audio. Enhances detection audio without + changing the audio used for recognition. The mode is not restricted to headset devices.""" + AZURE_PERSONAL_NOISE_SUPPRESSION = "azure_personal_noise_suppression" + """Azure personalized noise suppression for local voice activity detection. Starts with headset + suppression and personalizes detection after automatic speaker enrollment. Recognition audio is + unchanged; headset suppression remains active when personalization is unavailable.""" class VoiceAgentProfanityFilterMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -2761,6 +2867,25 @@ class VoiceAgentSessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMet """FILE_SEARCH_CALL_RESULTS.""" +class VoiceAgentSoundscapeSound(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The packaged sounds accepted by a built-in soundscape source.""" + + OFFICE = "office" + """Quiet office ambience.""" + CALL_CENTER = "call_center" + """Busy call-center ambience.""" + BUSY_STREET = "busy_street" + """Busy street ambience.""" + PEOPLE_TALKING = "people_talking" + """Crowd conversation ambience.""" + STREET_AND_METRO_STATION = "street_and_metro_station" + """Street and metro-station ambience.""" + DING1 = "ding1" + """The first notification tone.""" + DING2 = "ding2" + """The second notification tone.""" + + class VoiceAgentSubagentAbortReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The reason a subagent consultation was aborted.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 93d7f8d7f955..5d2580a8c1f1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -22,6 +22,7 @@ AgentOptimizationDataSourceType, AgentOptimizationEvaluationSetType, AgentOptimizationTargetConfigurationType, + AnswerResourceType, ContainerNetworkPolicyParamType, ContainerSkillType, CreateTranscriptionResponseJsonUsageType, @@ -51,6 +52,7 @@ OpenApiAuthType, OptimizationContextType, PendingUploadType, + QuestionParamType, RealtimeAudioFormatsType, RealtimeClientEventType, RealtimeConversationItemMessageType, @@ -181,14 +183,16 @@ class Tool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-on """A tool that can be used to generate a response. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - A2ATool, A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, + A2ATool, A2APreviewTool, ToolApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationTool, - BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, - ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, - FileSearchTool, FunctionTool, GitHubCopilotToolsetPreview, ImageGenTool, LocalShellToolParam, - MCPTool, MemorySearchPreviewTool, MicrosoftCopilotToolsetPreview, NamespaceToolParam, - OpenApiTool, ProgrammaticToolCallingParam, SharepointPreviewTool, FunctionShellToolParam, - ToolSearchToolParam, WebIQPreviewTool, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool + BrowserAutomationPreviewTool, CaptureStructuredOutputsTool, ToolCodeInterpreterTool, + ToolComputerTool, ToolComputerUsePreviewTool, ToolCustomToolParam, MicrosoftFabricPreviewTool, + FabricIQPreviewTool, ToolFileSearchTool, ToolFunctionTool, GitHubCopilotToolsetPreview, + ToolImageGenTool, ToolLocalShellToolParam, ToolMcpTool, MemorySearchPreviewTool, + MicrosoftCopilotToolsetPreview, NamespaceToolParam, OpenApiTool, + ToolProgrammaticToolCallingParam, SharepointPreviewTool, ToolFunctionShellToolParam, + ToolToolSearchToolParam, WebIQPreviewTool, ToolWebSearchTool, ToolWebSearchPreviewTool, + WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", "computer_use_preview", "web_search", "mcp", "code_interpreter", "programmatic_tool_calling", @@ -4671,6 +4675,218 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class AnswerResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A completed question always includes its name, including null when unnamed. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AnswerResourceChoice, AnswerResourcePredicate, AnswerResourceRefusal, AnswerResourceScore + + :ivar type: Required. Known values are: "predicate", "choice", "score", and "refusal". + :vartype type: str or ~azure.ai.projects.models.AnswerResourceType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"predicate\", \"choice\", \"score\", and \"refusal\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AnswerResourceChoice( + AnswerResource, discriminator="choice" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """AnswerResourceChoice. + + :ivar type: The type of the object. Always ``choice``. Required. CHOICE. + :vartype type: str or ~azure.ai.projects.models.CHOICE + :ivar name: Required. + :vartype name: str + :ivar choice: Required. Is either a str type or a bool type. + :vartype choice: str or bool + :ivar probabilities: Required. + :vartype probabilities: list[~azure.ai.projects.models.ChoiceProbabilityResource] + :ivar confidence: Required. + :vartype confidence: float + """ + + type: Literal[AnswerResourceType.CHOICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``choice``. Required. CHOICE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + choice: "_unions.ChoiceValueResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a str type or a bool type.""" + probabilities: list["_models.ChoiceProbabilityResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + confidence: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + choice: "_unions.ChoiceValueResource", + probabilities: list["_models.ChoiceProbabilityResource"], + confidence: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.CHOICE # type: ignore + + +class AnswerResourcePredicate( + AnswerResource, discriminator="predicate" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """AnswerResourcePredicate. + + :ivar type: The type of the object. Always ``predicate``. Required. PREDICATE. + :vartype type: str or ~azure.ai.projects.models.PREDICATE + :ivar name: Required. + :vartype name: str + :ivar probability: Required. + :vartype probability: float + """ + + type: Literal[AnswerResourceType.PREDICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``predicate``. Required. PREDICATE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + probability: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + probability: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.PREDICATE # type: ignore + + +class AnswerResourceRefusal( + AnswerResource, discriminator="refusal" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The model declined to answer this question. Other questions in the same request can still + receive answers. + + :ivar type: The type of the object. Always ``refusal``. Required. REFUSAL. + :vartype type: str or ~azure.ai.projects.models.REFUSAL + :ivar name: Required. + :vartype name: str + """ + + type: Literal[AnswerResourceType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``refusal``. Required. REFUSAL.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.REFUSAL # type: ignore + + +class AnswerResourceScore( + AnswerResource, discriminator="score" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """AnswerResourceScore. + + :ivar type: The type of the object. Always ``score``. Required. SCORE. + :vartype type: str or ~azure.ai.projects.models.SCORE + :ivar name: Required. + :vartype name: str + :ivar score: Required. + :vartype score: float + :ivar probabilities: Required. + :vartype probabilities: list[~azure.ai.projects.models.ScoreProbabilityResource] + :ivar confidence: Required. + :vartype confidence: float + """ + + type: Literal[AnswerResourceType.SCORE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``score``. Required. SCORE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + probabilities: list["_models.ScoreProbabilityResource"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + confidence: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + name: str, + score: float, + probabilities: list["_models.ScoreProbabilityResource"], + confidence: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnswerResourceType.SCORE # type: ignore + + class ApiError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ApiError. @@ -4796,42 +5012,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.API_KEY # type: ignore -class ApplyPatchToolParam( - Tool, discriminator="apply_patch" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Apply patch tool. - - :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - """ - - type: Literal[ToolType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.APPLY_PATCH # type: ignore - - class ApproximateLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ApproximateLocation. @@ -6506,6 +6686,71 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore +class ChoiceOptionParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ChoiceOptionParam. + + :ivar value: Required. Is either a str type or a bool type. + :vartype value: str or bool + :ivar description: + :vartype description: str + """ + + value: "_unions.ChoiceValueParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a str type or a bool type.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + value: "_unions.ChoiceValueParam", + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChoiceProbabilityResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ChoiceProbabilityResource. + + :ivar value: Required. Is either a str type or a bool type. + :vartype value: str or bool + :ivar probability: Required. + :vartype probability: float + """ + + value: "_unions.ChoiceValueResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a str type or a bool type.""" + probability: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + value: "_unions.ChoiceValueResource", + probability: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class ClusterInsightResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Insights from the cluster analysis. @@ -6803,75 +7048,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeInterpreterTool( - Tool, discriminator="code_interpreter" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Code interpreter. - - :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. - CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar container: The code interpreter container. Can be a container ID or an object that - specifies uploaded file IDs to make available to your code, along with an optional - ``memory_limit`` setting. If not provided, the service assumes auto. Is either a str type or a - AutoCodeInterpreterToolParam type. - :vartype container: str or ~azure.ai.projects.models.AutoCodeInterpreterToolParam - """ - - type: Literal[ToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The code interpreter container. Can be a container ID or an object that specifies uploaded file - IDs to make available to your code, along with an optional ``memory_limit`` setting. If not - provided, the service assumes auto. Is either a str type or a AutoCodeInterpreterToolParam - type.""" - - @overload - def __init__( - self, - *, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.CODE_INTERPRETER # type: ignore - - class CodeInterpreterToolboxTool( ToolboxTool, discriminator="code_interpreter" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -7008,13 +7184,14 @@ class CompoundFilter(_Model): # pylint: disable=docstring-keyword-should-match- :vartype type: str or str :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required. - :vartype filters: list[~azure.ai.projects.models.ComparisonFilter or any] + :vartype filters: list[~azure.ai.projects.models.ComparisonFilter or + ~azure.ai.projects.models.CompoundFilter] """ type: Literal["and", "or"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a Literal[\"or\"] type.""" - filters: list[Union["_models.ComparisonFilter", Any]] = rest_field( + filters: list[Union["_models.ComparisonFilter", "_models.CompoundFilter"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" @@ -7024,7 +7201,7 @@ def __init__( self, *, type: Literal["and", "or"], - filters: list[Union["_models.ComparisonFilter", Any]], + filters: list[Union["_models.ComparisonFilter", "_models.CompoundFilter"]], ) -> None: ... @overload @@ -7038,84 +7215,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ComputerTool(Tool, discriminator="computer"): - """Computer. - - :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER - """ - - type: Literal[ToolType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.COMPUTER # type: ignore - - -class ComputerUsePreviewTool( - Tool, discriminator="computer_use_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Computer use preview. - - :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. - COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW - :ivar environment: The type of computer environment to control. Required. Known values are: - "windows", "mac", "linux", "ubuntu", and "browser". - :vartype environment: str or ~azure.ai.projects.models.ComputerEnvironment - :ivar display_width: The width of the computer display. Required. - :vartype display_width: int - :ivar display_height: The height of the computer display. Required. - :vartype display_height: int - """ - - type: Literal[ToolType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer use tool. Always ``computer_use_preview``. Required. - COMPUTER_USE_PREVIEW.""" - environment: Union[str, "_models.ComputerEnvironment"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", - \"linux\", \"ubuntu\", and \"browser\".""" - display_width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The width of the computer display. Required.""" - display_height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The height of the computer display. Required.""" - - @overload - def __init__( - self, - *, - environment: Union[str, "_models.ComputerEnvironment"], - display_width: int, - display_height: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore - - class Connection(_Model): """Response from the list and get connections operations. @@ -8233,11 +8332,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CustomToolParamFormatType.TEXT # type: ignore -class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only +class CustomToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Custom tool. - :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. - :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar type: The type of the custom tool. Always ``custom``. Required. Default value is + "custom". + :vartype type: str :ivar name: The name of the custom tool, used to identify it in tool calls. Required. :vartype name: str :ivar async_property: Whether the tool response can be returned asynchronously versus @@ -8253,8 +8353,8 @@ class CustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstrin :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] """ - type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" + type: Literal["custom"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the custom tool. Always ``custom``. Required. Default value is \"custom\".""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the custom tool, used to identify it in tool calls. Required.""" async_property: Optional[bool] = rest_field( @@ -8295,7 +8395,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CUSTOM # type: ignore + self.type: Literal["custom"] = "custom" class RecurrenceSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -8917,6 +9017,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class DecisionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """DecisionResponse. + + :ivar model: The model used. Required. + :vartype model: str + :ivar answers: Answers in question order. Any question can return a refusal instead of an + answer; other questions can still receive answers. A refusal has ``type: "refusal"`` and the + question's ``name``, or ``null`` if it was unnamed. Required. + :vartype answers: list[~azure.ai.projects.models.AnswerResource] + :ivar usage: Token usage for the request. Required. + :vartype usage: ~azure.ai.projects.models.ResponseUsageResource + """ + + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used. Required.""" + answers: list["_models.AnswerResource"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Answers in question order. Any question can return a refusal instead of an answer; other + questions can still receive answers. A refusal has ``type: \"refusal\"`` and the question's + ``name``, or ``null`` if it was unnamed. Required.""" + usage: "_models.ResponseUsageResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage for the request. Required.""" + + @overload + def __init__( + self, + *, + model: str, + answers: list["_models.AnswerResource"], + usage: "_models.ResponseUsageResource", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class Delegation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Who handles tasks delegated by the Live model. Omitted or null selects your application; use ``responses`` to let the API manage a Responses backend. @@ -11389,77 +11531,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FILE # type: ignore -class FileSearchTool(Tool, discriminator="file_search"): # pylint: disable=docstring-keyword-should-match-keyword-only - """File search. - - :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH - :ivar vector_store_ids: The IDs of the vector stores to search. Required. - :vartype vector_store_ids: list[str] - :ivar max_num_results: The maximum number of results to return. This number should be between 1 - and 50 inclusive. - :vartype max_num_results: int - :ivar ranking_options: Ranking options for search. - :vartype ranking_options: ~azure.ai.projects.models.RankingOptions - :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. - :vartype filters: ~azure.ai.projects.models.ComparisonFilter or - ~azure.ai.projects.models.CompoundFilter - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - """ - - type: Literal[ToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" - vector_store_ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The IDs of the vector stores to search. Required.""" - max_num_results: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" - ranking_options: Optional["_models.RankingOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Ranking options for search.""" - filters: Optional["_unions.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a ComparisonFilter type or a CompoundFilter type.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - - @overload - def __init__( - self, - *, - vector_store_ids: list[str], - max_num_results: Optional[int] = None, - ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_unions.Filters"] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.FILE_SEARCH # type: ignore - - class FileSearchToolboxTool( ToolboxTool, discriminator="file_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -11747,67 +11818,6 @@ class FunctionParameters(_Model): """ -class FunctionShellToolParam( - Tool, discriminator="shell" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Shell tool. - - :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL - :ivar environment: - :vartype environment: ~azure.ai.projects.models.FunctionShellToolParamEnvironment - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - """ - - type: Literal[ToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell tool. Always ``shell``. Required. SHELL.""" - environment: Optional["_models.FunctionShellToolParamEnvironment"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - - @overload - def __init__( - self, - *, - environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.SHELL # type: ignore - - class FunctionShellToolParamEnvironmentContainerReferenceParam( FunctionShellToolParamEnvironment, discriminator="container_reference" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only @@ -11881,74 +11891,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = FunctionShellToolParamEnvironmentType.LOCAL # type: ignore -class FunctionTool(Tool, discriminator="function"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function. - - :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. - :vartype type: str or ~azure.ai.projects.models.FUNCTION - :ivar name: The name of the function to call. Required. - :vartype name: str - :ivar async_property: - :vartype async_property: bool - :ivar description: - :vartype description: str - :ivar parameters: Required. - :vartype parameters: dict[str, any] - :ivar output_schema: - :vartype output_schema: dict[str, any] - :ivar strict: Required. - :vartype strict: bool - :ivar defer_loading: Whether this function is deferred and loaded via tool search. - :vartype defer_loading: bool - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - """ - - type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool. Always ``function``. Required. FUNCTION.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to call. Required.""" - async_property: Optional[bool] = rest_field( - name="async", visibility=["read", "create", "update", "delete", "query"] - ) - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this function is deferred and loaded via tool search.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - name: str, - parameters: dict[str, Any], - strict: bool, - async_property: Optional[bool] = None, - description: Optional[str] = None, - output_schema: Optional[dict[str, Any]] = None, - defer_loading: Optional[bool] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore - - class FunctionToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """FunctionToolParam. @@ -12600,214 +12542,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageGenTool( - Tool, discriminator="image_generation" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Image generation tool. - - :ivar type: The type of the image generation tool. Always ``image_generation``. Required. - IMAGE_GENERATION. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION - :ivar model: Is one of the following types: Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-2.5-sunburst"], - Literal["gpt-image-2.5-sunburst-2026-09-08"], Literal["gpt-image-2.5-flare"], - Literal["gpt-image-2.5-flare-2026-09-08"], str - :vartype model: str or str or str or str or str or str or str or str or str or str - :ivar quality: The quality of the generated image. The GPT image models support ``low``, - ``medium``, and ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including - their ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one - of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"], - Literal["max"], Literal["auto"] - :vartype quality: str or str or str or str or str or str - :ivar size: The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, - ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and - ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` - strings, for example ``1536x864``. Width and height must both be divisible by 16 and the - requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are - experimental, and the maximum supported resolution is ``3840x2160``. The requested size must - also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, - ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported - for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, - or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. - Is one of the following types: Literal["1024x1024"], Literal["1024x1536"], - Literal["1536x1024"], Literal["auto"], str - :vartype size: str or str or str or str or str - :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or - ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], - Literal["jpeg"] - :vartype output_format: str or str or str - :ivar output_compression: Compression level for the output image. Default: 100. - :vartype output_compression: int - :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a - Literal["auto"] type or a Literal["low"] type. - :vartype moderation: str or str - :ivar background: Set the background of the generated image. One of ``transparent``, - ``opaque``, or ``auto``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including - their ``2026-09-08`` snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent - backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the - output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: - Literal["transparent"], Literal["opaque"], Literal["auto"] - :vartype background: str or str or str - :ivar input_fidelity: Known values are: "high" and "low". - :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity - :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) - and ``file_id`` (string, optional). - :vartype input_image_mask: ~azure.ai.projects.models.ImageGenToolInputImageMask - :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default - value) to 3. - :vartype partial_images: int - :ivar action: Whether to generate a new image or edit an existing image. Default: ``auto``. - Known values are: "generate", "edit", and "auto". - :vartype action: str or ~azure.ai.projects.models.ImageGenAction - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - """ - - type: Literal[ToolType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" - model: Optional[ - Union[ - Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], - Literal["gpt-image-1.5"], - Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], - Literal["gpt-image-2.5-sunburst"], - Literal["gpt-image-2.5-sunburst-2026-09-08"], - Literal["gpt-image-2.5-flare"], - Literal["gpt-image-2.5-flare-2026-09-08"], - str, - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], - Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], - Literal[\"gpt-image-2.5-sunburst\"], Literal[\"gpt-image-2.5-sunburst-2026-09-08\"], - Literal[\"gpt-image-2.5-flare\"], Literal[\"gpt-image-2.5-flare-2026-09-08\"], str""" - quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The quality of the generated image. The GPT image models support ``low``, ``medium``, and - ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their - ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one of the - following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"], - Literal[\"max\"], Literal[\"auto\"]""" - size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, - ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and - ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` - strings, for example ``1536x864``. Width and height must both be divisible by 16 and the - requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are - experimental, and the maximum supported resolution is ``3840x2160``. The requested size must - also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, - ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported - for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, - or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. - Is one of the following types: Literal[\"1024x1024\"], Literal[\"1024x1536\"], - Literal[\"1536x1024\"], Literal[\"auto\"], str""" - output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: - ``png``. Is one of the following types: Literal[\"png\"], Literal[\"webp\"], Literal[\"jpeg\"]""" - output_compression: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Compression level for the output image. Default: 100.""" - moderation: Optional[Literal["auto", "low"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type - or a Literal[\"low\"] type.""" - background: Optional[Literal["transparent", "opaque", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. - ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their ``2026-09-08`` - snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent backgrounds are - available for supported GPT Image models. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, - this support is in preview. When using ``transparent``, set the output format to ``png`` or - ``webp``. Default: ``auto``. Is one of the following types: Literal[\"transparent\"], - Literal[\"opaque\"], Literal[\"auto\"]""" - input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"high\" and \"low\".""" - input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` - (string, optional).""" - partial_images: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" - action: Optional[Union[str, "_models.ImageGenAction"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: - \"generate\", \"edit\", and \"auto\".""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - - @overload - def __init__( - self, - *, - model: Optional[ - Union[ - Literal["gpt-image-1"], - Literal["gpt-image-1-mini"], - Literal["gpt-image-1.5"], - Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], - Literal["gpt-image-2.5-sunburst"], - Literal["gpt-image-2.5-sunburst-2026-09-08"], - Literal["gpt-image-2.5-flare"], - Literal["gpt-image-2.5-flare-2026-09-08"], - str, - ] - ] = None, - quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None, - size: Optional[ - Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] - ] = None, - output_format: Optional[Literal["png", "webp", "jpeg"]] = None, - output_compression: Optional[int] = None, - moderation: Optional[Literal["auto", "low"]] = None, - background: Optional[Literal["transparent", "opaque", "auto"]] = None, - input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = None, - input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = None, - partial_images: Optional[int] = None, - action: Optional[Union[str, "_models.ImageGenAction"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.IMAGE_GENERATION # type: ignore - - class ImageGenToolInputImageMask(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ImageGenToolInputImageMask. @@ -12925,6 +12659,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.media_type: Literal["application/zip"] = "application/zip" +class InputTokensDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """InputTokensDetailsResource. + + :ivar cached_tokens: Required. + :vartype cached_tokens: int + :ivar cache_write_tokens: Required. + :vartype cache_write_tokens: int + """ + + cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + cache_write_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + cached_tokens: int, + cache_write_tokens: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class Insight(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The response body for cluster insights. @@ -13506,6 +13273,103 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class LiveAllowedToolsChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveAllowedToolsChoiceParam. + + :ivar type: The tool choice type. Always ``allowed_tools``. Required. Default value is + "allowed_tools". + :vartype type: str + :ivar tools: The tools that the delegated Responses model may call. Required. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam or + ~azure.ai.projects.models.LiveSpecificFileSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchPreviewParam or + ~azure.ai.projects.models.LiveSpecificImageGenParam or + ~azure.ai.projects.models.LiveSpecificComputerParam or + ~azure.ai.projects.models.LiveSpecificCodeInterpreterParam or + ~azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam or + ~azure.ai.projects.models.LiveSpecificFunctionShellParam or + ~azure.ai.projects.models.LiveSpecificCustomToolParam or + ~azure.ai.projects.models.LiveSpecificApplyPatchParam] + :ivar mode: Known values are: "none", "auto", and "required". + :vartype mode: str or ~azure.ai.projects.models.LiveToolChoiceValueEnum + """ + + type: Literal["allowed_tools"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool choice type. Always ``allowed_tools``. Required. Default value is \"allowed_tools\".""" + tools: list[ + Union[ + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tools that the delegated Responses model may call. Required.""" + mode: Optional[Union[str, "_models.LiveToolChoiceValueEnum"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"none\", \"auto\", and \"required\".""" + + @overload + def __init__( + self, + *, + tools: list[ + Union[ + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + ] + ], + mode: Optional[Union[str, "_models.LiveToolChoiceValueEnum"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["allowed_tools"] = "allowed_tools" + + +class LiveApplyPatchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveApplyPatchToolInputParam. + + :ivar type: Required. Default value is "apply_patch". + :vartype type: str + """ + + type: Literal["apply_patch"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"apply_patch\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["apply_patch"] = "apply_patch" + + class LiveAudioFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. WebRTC and SIP negotiate their media format separately. @@ -13610,16 +13474,19 @@ class LiveClientEvent(_Model): # pylint: disable=docstring-keyword-should-match instructions and delegation policies. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - LiveClientEventLiveResponseCreateParam, LiveClientEventLiveResponseItemCreateParam, - LiveClientEventLiveSessionCloseParam, LiveClientEventLiveCommentaryAppendParam, - LiveClientEventLiveInputAudioAppendEvent, LiveClientEventLiveInputAudioMuteParam, - LiveClientEventLiveInputAudioUnmuteParam, LiveClientEventLiveInstructionsAppendParam, + LiveClientEventLiveDecisionCreateParam, LiveClientEventLiveDecisionItemCreateParam, + LiveClientEventLiveDecisionItemDeleteParam, LiveClientEventLiveResponseCreateParam, + LiveClientEventLiveResponseItemCreateParam, LiveClientEventLiveSessionCloseParam, + LiveClientEventLiveCommentaryAppendParam, LiveClientEventLiveInputAudioAppendEvent, + LiveClientEventLiveInputAudioMuteParam, LiveClientEventLiveInputAudioUnmuteParam, + LiveClientEventLiveInstructionsAppendParam, LiveClientEventLiveOutputAudioFixturePlayParam, LiveSessionStartEvent, LiveClientEventLiveThinkingAppendParam, LiveClientEventLiveSessionUpdateParam :ivar type: Required. Known values are: "session.start", "session.update", "session.input_audio.append", "session.input_audio.mute", "session.input_audio.unmute", - "session.instructions.append", "session.thinking.append", "session.commentary.append", + "session.output_audio.fixture.play", "session.instructions.append", "session.thinking.append", + "session.commentary.append", "decision.create", "decision.item.create", "decision.item.delete", "response.item.create", "response.create", and "session.close". :vartype type: str or ~azure.ai.projects.models.LiveClientEventType """ @@ -13628,8 +13495,10 @@ class LiveClientEvent(_Model): # pylint: disable=docstring-keyword-should-match type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """Required. Known values are: \"session.start\", \"session.update\", \"session.input_audio.append\", \"session.input_audio.mute\", \"session.input_audio.unmute\", - \"session.instructions.append\", \"session.thinking.append\", \"session.commentary.append\", - \"response.item.create\", \"response.create\", and \"session.close\".""" + \"session.output_audio.fixture.play\", \"session.instructions.append\", + \"session.thinking.append\", \"session.commentary.append\", \"decision.create\", + \"decision.item.create\", \"decision.item.delete\", \"response.item.create\", + \"response.create\", and \"session.close\".""" @overload def __init__( @@ -13653,7 +13522,7 @@ class LiveClientEventLiveCommentaryAppendParam( LiveClientEvent, discriminator="session.commentary.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only """Provide context the Live model can communicate to the user, optionally for an existing client - delegation. + delegation. Rejected while an audio fixture is active. :ivar event_id: :vartype event_id: str @@ -13698,6 +13567,122 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = LiveClientEventType.SESSION_COMMENTARY_APPEND # type: ignore +class LiveClientEventLiveDecisionCreateParam( + LiveClientEvent, discriminator="decision.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Evaluate the configured questions using the current conversation and Decision inputs. Reusing + an event_id is rejected for the lifetime of the session. + + :ivar event_id: Required. + :vartype event_id: str + :ivar type: Required. DECISION_CREATE. + :vartype type: str or ~azure.ai.projects.models.DECISION_CREATE + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: Literal[LiveClientEventType.DECISION_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_CREATE.""" + + @overload + def __init__( + self, + *, + event_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.DECISION_CREATE # type: ignore + + +class LiveClientEventLiveDecisionItemCreateParam( + LiveClientEvent, discriminator="decision.item.create" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Append an input item for future decisions without starting an evaluation or changing Live voice + context. + + :ivar event_id: + :vartype event_id: str + :ivar type: Required. DECISION_ITEM_CREATE. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_CREATE + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.LiveDecisionInputItemParam + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.DECISION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_CREATE.""" + item: "_models.LiveDecisionInputItemParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item: "_models.LiveDecisionInputItemParam", + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.DECISION_ITEM_CREATE # type: ignore + + +class LiveClientEventLiveDecisionItemDeleteParam( + LiveClientEvent, discriminator="decision.item.delete" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Delete an input item from future decisions without starting an evaluation or changing Live + voice context. + + :ivar event_id: + :vartype event_id: str + :ivar type: Required. DECISION_ITEM_DELETE. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_DELETE + :ivar item_id: Required. + :vartype item_id: str + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.DECISION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_DELETE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.DECISION_ITEM_DELETE # type: ignore + + class LiveClientEventLiveInputAudioAppendEvent( LiveClientEvent, discriminator="session.input_audio.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -13787,7 +13772,8 @@ class LiveClientEventLiveInputAudioUnmuteParam( LiveClientEvent, discriminator="session.input_audio.unmute" ): # pylint: disable=docstring-keyword-should-match-keyword-only """Resume audio input to a Live model after muting it. The server acknowledges with - ``session.input_audio.unmuted``. + ``session.input_audio.unmuted``. An active audio fixture still pauses inference until playback + finishes. :ivar event_id: :vartype event_id: str @@ -13823,8 +13809,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class LiveClientEventLiveInstructionsAppendParam( LiveClientEvent, discriminator="session.instructions.append" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Append instructions to the Live conversation while it is running, optionally associating them - with an existing client delegation. + """Append developer instructions to the Live conversation while it is running, optionally + associating them with an existing client delegation. Rejected while an audio fixture is active. + These instructions remain in conversation history through compaction and are included in future + backend delegations. For external audio, describe content already delivered so the assistant + does not repeat it. :ivar event_id: :vartype event_id: str @@ -13869,6 +13858,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = LiveClientEventType.SESSION_INSTRUCTIONS_APPEND # type: ignore +class LiveClientEventLiveOutputAudioFixturePlayParam( + LiveClientEvent, discriminator="session.output_audio.fixture.play" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Play one complete audio fixture through the session output. Send this event over the primary + WebSocket or a server sideband. Audio must be raw mono PCM16 little-endian at 24 kHz, + regardless of the session audio format, and at most 30 seconds. The entire payload is validated + before model speech is interrupted and input is muted. Only one fixture can be active. + fixture.playing acknowledges acceptance and fixture.played reports server mixer drain. These + notifications are not exact transport-media boundaries. Input arriving during playback is + dropped and not replayed. + + :ivar event_id: + :vartype event_id: str + :ivar type: Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAY. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY + :ivar audio: Base64-encoded raw mono PCM16 audio, little-endian, at 24 kHz. Do not include a + WAV or other container header. Required. + :vartype audio: str + """ + + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAY.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw mono PCM16 audio, little-endian, at 24 kHz. Do not include a WAV or other + container header. Required.""" + + @overload + def __init__( + self, + *, + audio: str, + event_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAY # type: ignore + + class LiveClientEventLiveResponseCreateParam( LiveClientEvent, discriminator="response.create" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -13985,16 +14021,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class LiveClientEventLiveSessionUpdateParam( LiveClientEvent, discriminator="session.update" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Update the delegation settings of an active Live session. The server acknowledges accepted - changes with ``session.updated``. + """Update the delegation settings or transcript triggers of an active Live session. The server + acknowledges accepted changes with ``session.updated``. :ivar event_id: :vartype event_id: str :ivar type: The Live client event type. Always ``session.update``. Required. SESSION_UPDATE. :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATE - :ivar session: Sparse delegation updates. Omitted settings retain their values. The delegation - type cannot change, including resetting Responses delegation to null or client. Model, frontend - instructions, audio, and startup input are immutable. Required. + :ivar session: Sparse delegation and trigger updates. Omitted settings retain their values. The + delegation type cannot change. Model, frontend instructions, audio, and startup input are + immutable. Required. :vartype session: ~azure.ai.projects.models.LiveSessionUpdateParams """ @@ -14002,9 +14038,9 @@ class LiveClientEventLiveSessionUpdateParam( type: Literal[LiveClientEventType.SESSION_UPDATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Live client event type. Always ``session.update``. Required. SESSION_UPDATE.""" session: "_models.LiveSessionUpdateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sparse delegation updates. Omitted settings retain their values. The delegation type cannot - change, including resetting Responses delegation to null or client. Model, frontend - instructions, audio, and startup input are immutable. Required.""" + """Sparse delegation and trigger updates. Omitted settings retain their values. The delegation + type cannot change. Model, frontend instructions, audio, and startup input are immutable. + Required.""" @overload def __init__( @@ -14030,7 +14066,7 @@ class LiveClientEventLiveThinkingAppendParam( LiveClientEvent, discriminator="session.thinking.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only """Provide silent reasoning or progress context to the Live model, optionally for an existing - client delegation. + client delegation. Rejected while an audio fixture is active. :ivar event_id: :vartype event_id: str @@ -14076,6 +14112,87 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = LiveClientEventType.SESSION_THINKING_APPEND # type: ignore +class LiveCodeInterpreterToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveCodeInterpreterToolInputParam. + + :ivar type: Required. Default value is "code_interpreter". + :vartype type: str + """ + + type: Literal["code_interpreter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"code_interpreter\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["code_interpreter"] = "code_interpreter" + + +class LiveComputerToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveComputerToolInputParam. + + :ivar type: Required. Default value is "computer". + :vartype type: str + """ + + type: Literal["computer"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"computer\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["computer"] = "computer" + + +class LiveContainerNetworkPolicyDisabledParam(_Model): # pylint: disable=docstring-missing-param + """LiveContainerNetworkPolicyDisabledParam. + + :ivar type: Disable outbound network access. Always ``disabled``. Required. Default value is + "disabled". + :vartype type: str + """ + + type: Literal["disabled"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Disable outbound network access. Always ``disabled``. Required. Default value is \"disabled\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["disabled"] = "disabled" + + +class LiveContainerReferenceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveContainerReferenceParam. + + :ivar type: References a container created with the /v1/containers endpoint. Required. Default + value is "container_reference". + :vartype type: str + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str + """ + + type: Literal["container_reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """References a container created with the /v1/containers endpoint. Required. Default value is + \"container_reference\".""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced container. Required.""" + + @overload + def __init__( + self, + *, + container_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["container_reference"] = "container_reference" + + class LiveContextWindowUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The latest measured context-window usage of the Live model. This is separate from billing usage and delegated Responses token usage. @@ -14107,6 +14224,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class LiveCustomToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveCustomToolInputParam. + + :ivar type: Required. Default value is "custom". + :vartype type: str + """ + + type: Literal["custom"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"custom\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["custom"] = "custom" + + class LiveCustomVoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """LiveCustomVoiceParam. @@ -14185,30 +14317,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveDelegationReasoningInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reasoning options for Responses requests made on behalf of the Live session. +class LiveDecisionCompleted(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionCompleted. - :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: str or ~azure.ai.projects.models.LiveReasoningEffort - :ivar summary: Known values are: "concise", "detailed", and "auto". - :vartype summary: str or ~azure.ai.projects.models.LiveReasoningSummary + :ivar type: Required. Default value is "decision.completed". + :vartype type: str + :ivar decision: The native Decision API response, including its model, ordered answers, and + token usage. Required. + :vartype decision: ~azure.ai.projects.models.DecisionResponse """ - effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" - summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"concise\", \"detailed\", and \"auto\".""" + type: Literal["decision.completed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decision.completed\".""" + decision: "_models.DecisionResponse" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The native Decision API response, including its model, ordered answers, and token usage. + Required.""" @overload def __init__( self, *, - effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = None, - summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = None, + decision: "_models.DecisionResponse", ) -> None: ... @overload @@ -14220,25 +14349,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["decision.completed"] = "decision.completed" -class LiveDelegationTextInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Text generation options for the Live session’s Responses backend. +class LiveDecisionInputImageParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionInputImageParam. - :ivar verbosity: Known values are: "low", "medium", and "high". - :vartype verbosity: str or ~azure.ai.projects.models.LiveTextVerbosity + :ivar type: The type of the input item. Always ``input_image``. Required. Default value is + "input_image". + :vartype type: str + :ivar image_url: An inline image encoded as a data URL. Required. + :vartype image_url: str + :ivar detail: Known values are: "low", "high", "auto", and "original". + :vartype detail: str or ~azure.ai.projects.models.LiveDetailEnum """ - verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = rest_field( + type: Literal["input_image"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_image``. Required. Default value is \"input_image\".""" + image_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An inline image encoded as a data URL. Required.""" + detail: Optional[Union[str, "_models.LiveDetailEnum"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Known values are: \"low\", \"medium\", and \"high\".""" + """Known values are: \"low\", \"high\", \"auto\", and \"original\".""" @overload def __init__( self, *, - verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = None, + image_url: str, + detail: Optional[Union[str, "_models.LiveDetailEnum"]] = None, ) -> None: ... @overload @@ -14250,27 +14390,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["input_image"] = "input_image" -class LiveFunctionToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LiveFunctionToolChoiceParam. +class LiveDecisionInputItemParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionInputItemParam. - :ivar type: Required. Default value is "function". + :ivar id: + :vartype id: str + :ivar type: Default value is "message". :vartype type: str - :ivar name: Required. - :vartype name: str + :ivar role: The message role. Always ``user``. Required. Default value is "user". + :vartype role: str + :ivar content: Required. Is either a str type or a [Union["_models.LiveDecisionInputTextParam", + "_models.LiveDecisionInputImageParam"]] type. + :vartype content: str or list[~azure.ai.projects.models.LiveDecisionInputTextParam or + ~azure.ai.projects.models.LiveDecisionInputImageParam] """ - type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"function\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"message\".""" + role: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message role. Always ``user``. Required. Default value is \"user\".""" + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Required. Is either a str type or a [Union[\"_models.LiveDecisionInputTextParam\", + \"_models.LiveDecisionInputImageParam\"]] type.""" @overload def __init__( self, *, - name: str, + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, ) -> None: ... @overload @@ -14282,40 +14437,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["function"] = "function" + self.role: Literal["user"] = "user" -class LiveFunctionToolInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A function tool available to the Responses backend when the Live model delegates a task. +class LiveDecisionInputTextParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionInputTextParam. - :ivar type: The tool type. Always ``function``. Required. Default value is "function". + :ivar type: The type of the input item. Always ``input_text``. Required. Default value is + "input_text". :vartype type: str - :ivar name: The name the delegated Responses model uses when calling this function. Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: dict[str, any] - :ivar strict: - :vartype strict: bool + :ivar text: The text input to the model. Required. + :vartype text: str """ - type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The tool type. Always ``function``. Required. Default value is \"function\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name the delegated Responses model uses when calling this function. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["input_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_text``. Required. Default value is \"input_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text input to the model. Required.""" @overload def __init__( self, *, - name: str, - description: Optional[str] = None, - parameters: Optional[dict[str, Any]] = None, - strict: Optional[bool] = None, + text: str, ) -> None: ... @overload @@ -14327,30 +14471,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["function"] = "function" + self.type: Literal["input_text"] = "input_text" -class LiveInitialItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A developer, user, or assistant message supplied as text history before the Live session - starts. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - LiveInitialAssistantMessageItemParam, LiveInitialDeveloperMessageItemParam, - LiveInitialUserMessageItemParam +class LiveDecisionQuestionsInputParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Questions evaluated using the current transcript and the session's shared Decision items. - :ivar role: Required. Known values are: "developer", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.LiveInitialItemType + :ivar questions: Native Decision API questions evaluated together, in order. Required. + :vartype questions: list[~azure.ai.projects.models.QuestionParam] """ - __mapping__: dict[str, _Model] = {} - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"developer\", \"user\", and \"assistant\".""" + questions: list["_models.QuestionParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Native Decision API questions evaluated together, in order. Required.""" @overload def __init__( self, *, - role: str, + questions: list["_models.QuestionParam"], ) -> None: ... @overload @@ -14364,50 +14502,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveInitialAssistantMessageItemParam( - LiveInitialItem, discriminator="assistant" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An assistant message included in the initial text history of a Live session. +class LiveDecisionsDelegationParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsDelegationParam_2. - :ivar id: - :vartype id: str - :ivar type: The history item type. Always ``message``. Default value is "message". + :ivar type: Required. Default value is "decisions". :vartype type: str - :ivar status: Known values are: "incomplete" and "completed". - :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus - :ivar role: The author of this history message. Always ``assistant``. Required. ASSISTANT. - :vartype role: str or ~azure.ai.projects.models.ASSISTANT - :ivar content: The message content. Supply exactly one text part for the initial Live - conversation history. Required. - :vartype content: list[~azure.ai.projects.models.LiveInitialTextContentPartParam or - ~azure.ai.projects.models.LiveInitialOutputTextContentPartParam] + :ivar decisions: Required. + :vartype decisions: ~azure.ai.projects.models.LiveDecisionsSettingsInputParam_2 """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The history item type. Always ``message``. Default value is \"message\".""" - status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + type: Literal["decisions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decisions\".""" + decisions: "_models.LiveDecisionsSettingsInputParam_2" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Known values are: \"incomplete\" and \"completed\".""" - role: Literal[LiveInitialItemType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The author of this history message. Always ``assistant``. Required. ASSISTANT.""" - content: list[Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """The message content. Supply exactly one text part for the initial Live conversation history. - Required.""" + """Required.""" @overload def __init__( self, *, - content: list[ - Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"] - ], - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[Literal["message"]] = None, - status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, + decisions: "_models.LiveDecisionsSettingsInputParam_2", ) -> None: ... @overload @@ -14419,50 +14534,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = LiveInitialItemType.ASSISTANT # type: ignore + self.type: Literal["decisions"] = "decisions" -class LiveInitialDeveloperMessageItemParam( - LiveInitialItem, discriminator="developer" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A developer message included in the initial text history of a Live session. +class LiveDecisionsDelegationUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsDelegationUpdateParam. - :ivar id: - :vartype id: str - :ivar type: The history item type. Always ``message``. Default value is "message". + :ivar type: Required. Default value is "decisions". :vartype type: str - :ivar status: Known values are: "incomplete" and "completed". - :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus - :ivar role: The author of this history message. Always ``developer``. Required. DEVELOPER. - :vartype role: str or ~azure.ai.projects.models.DEVELOPER - :ivar content: The message content. Supply exactly one text part for the initial Live - conversation history. Required. - :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] + :ivar decisions: + :vartype decisions: ~azure.ai.projects.models.LiveDecisionsSettingsUpdateParam """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The history item type. Always ``message``. Default value is \"message\".""" - status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"incomplete\" and \"completed\".""" - role: Literal[LiveInitialItemType.DEVELOPER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The author of this history message. Always ``developer``. Required. DEVELOPER.""" - content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + type: Literal["decisions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decisions\".""" + decisions: Optional["_models.LiveDecisionsSettingsUpdateParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The message content. Supply exactly one text part for the initial Live conversation history. - Required.""" @overload def __init__( self, *, - content: list["_models.LiveInitialInputTextContentPartParam"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[Literal["message"]] = None, - status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, + decisions: Optional["_models.LiveDecisionsSettingsUpdateParam"] = None, ) -> None: ... @overload @@ -14474,30 +14568,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = LiveInitialItemType.DEVELOPER # type: ignore + self.type: Literal["decisions"] = "decisions" -class LiveInitialInputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Text supplied in a developer or user message when starting a Live session. +class LiveDecisionsSettingsInputParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsSettingsInputParam_2. - :ivar type: The text content type. Always ``input_text``. Default value is "input_text". - :vartype type: str - :ivar text: The message text to include in the Live session’s initial conversation history. - Required. - :vartype text: str + :ivar questions: Native Decision API questions evaluated together, in order. Required. + :vartype questions: list[~azure.ai.projects.models.QuestionParam] + :ivar model: Required. + :vartype model: str """ - type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text content type. Always ``input_text``. Default value is \"input_text\".""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The message text to include in the Live session’s initial conversation history. Required.""" + questions: list["_models.QuestionParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Native Decision API questions evaluated together, in order. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - text: str, - type: Optional[Literal["input_text"]] = None, + questions: list["_models.QuestionParam"], + model: str, ) -> None: ... @overload @@ -14511,27 +14604,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveInitialOutputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Assistant output text supplied as conversation history when starting a Live session. +class LiveDecisionsSettingsUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionsSettingsUpdateParam. - :ivar type: The text content type. Always ``output_text``. Required. Default value is - "output_text". - :vartype type: str - :ivar text: The message text to include in the Live session’s initial conversation history. - Required. - :vartype text: str + :ivar model: + :vartype model: str + :ivar questions: Native Decision API questions evaluated together, in order. + :vartype questions: list[~azure.ai.projects.models.QuestionParam] """ - type: Literal["output_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text content type. Always ``output_text``. Required. Default value is \"output_text\".""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The message text to include in the Live session’s initial conversation history. Required.""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + questions: Optional[list["_models.QuestionParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Native Decision API questions evaluated together, in order.""" @overload def __init__( self, *, - text: str, + model: Optional[str] = None, + questions: Optional[list["_models.QuestionParam"]] = None, ) -> None: ... @overload @@ -14543,93 +14636,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["output_text"] = "output_text" -class LiveInitialSessionAudioOutputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Settings for speech generated by the Live model. Choose the voice before starting the session. +class LiveDecisionStoredInputItemParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionStoredInputItemParam. - :ivar voice: The voice used for Live speech, as a built-in voice name or a custom voice object - containing its ID. Defaults to ``marin`` and cannot change after startup. Is one of the - following types: str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], - Literal["bossa"], Literal["cedar"], Literal["cinder"], Literal["coral"], Literal["delta"], - Literal["echo"], Literal["gleam"], Literal["marin"], Literal["meridian"], Literal["quartz"], - Literal["ripple"], Literal["sage"], Literal["shimmer"], Literal["stone"], Literal["tempo"], - Literal["verse"], Literal["vesper"], Literal["willow"], LiveCustomVoiceParam - :vartype voice: str or str or str or str or str or str or str or str or str or str or str or - str or str or str or str or str or str or str or str or str or str or str or str or - ~azure.ai.projects.models.LiveCustomVoiceParam + :ivar id: The ID of the stored Decision input item. Required. + :vartype id: str + :ivar type: Default value is "message". + :vartype type: str + :ivar role: The message role. Always ``user``. Required. Default value is "user". + :vartype role: str + :ivar content: Required. Is either a str type or a [Union["_models.LiveDecisionInputTextParam", + "_models.LiveDecisionInputImageParam"]] type. + :vartype content: str or list[~azure.ai.projects.models.LiveDecisionInputTextParam or + ~azure.ai.projects.models.LiveDecisionInputImageParam] """ - voice: Optional[ - Union[ - str, - Literal["alloy"], - Literal["ash"], - Literal["ballad"], - Literal["beacon"], - Literal["bossa"], - Literal["cedar"], - Literal["cinder"], - Literal["coral"], - Literal["delta"], - Literal["echo"], - Literal["gleam"], - Literal["marin"], - Literal["meridian"], - Literal["quartz"], - Literal["ripple"], - Literal["sage"], - Literal["shimmer"], - Literal["stone"], - Literal["tempo"], - Literal["verse"], - Literal["vesper"], - Literal["willow"], - "_models.LiveCustomVoiceParam", - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice used for Live speech, as a built-in voice name or a custom voice object containing - its ID. Defaults to ``marin`` and cannot change after startup. Is one of the following types: - str, Literal[\"alloy\"], Literal[\"ash\"], Literal[\"ballad\"], Literal[\"beacon\"], - Literal[\"bossa\"], Literal[\"cedar\"], Literal[\"cinder\"], Literal[\"coral\"], - Literal[\"delta\"], Literal[\"echo\"], Literal[\"gleam\"], Literal[\"marin\"], - Literal[\"meridian\"], Literal[\"quartz\"], Literal[\"ripple\"], Literal[\"sage\"], - Literal[\"shimmer\"], Literal[\"stone\"], Literal[\"tempo\"], Literal[\"verse\"], - Literal[\"vesper\"], Literal[\"willow\"], LiveCustomVoiceParam""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the stored Decision input item. Required.""" + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"message\".""" + role: Literal["user"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message role. Always ``user``. Required. Default value is \"user\".""" + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Required. Is either a str type or a [Union[\"_models.LiveDecisionInputTextParam\", + \"_models.LiveDecisionInputImageParam\"]] type.""" @overload def __init__( self, *, - voice: Optional[ - Union[ - str, - Literal["alloy"], - Literal["ash"], - Literal["ballad"], - Literal["beacon"], - Literal["bossa"], - Literal["cedar"], - Literal["cinder"], - Literal["coral"], - Literal["delta"], - Literal["echo"], - Literal["gleam"], - Literal["marin"], - Literal["meridian"], - Literal["quartz"], - Literal["ripple"], - Literal["sage"], - Literal["shimmer"], - Literal["stone"], - Literal["tempo"], - Literal["verse"], - Literal["vesper"], - Literal["willow"], - "_models.LiveCustomVoiceParam", - ] - ] = None, + id: str, # pylint: disable=redefined-builtin + content: Union[str, list[Union["_models.LiveDecisionInputTextParam", "_models.LiveDecisionInputImageParam"]]], + type: Optional[Literal["message"]] = None, ) -> None: ... @overload @@ -14641,33 +14683,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role: Literal["user"] = "user" -class LiveInitialSessionAudioParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP - negotiate their media format. Voice and format are immutable after startup. +class LiveDecisionTriggerInputParam_2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveDecisionTriggerInputParam_2. - :ivar format: Audio encoding and sample rate for audio sent and received over a Live WebSocket - connection. WebRTC and SIP negotiate their media format separately. - :vartype format: ~azure.ai.projects.models.LiveAudioFormat - :ivar output: The voice used for speech generated by the Live model. - :vartype output: ~azure.ai.projects.models.LiveInitialSessionAudioOutputParam + :ivar type: Required. Default value is "decisions". + :vartype type: str + :ivar event_type: Required. Is either a Literal["session.input_transcript.delta"] type or a + Literal["session.output_transcript.delta"] type. + :vartype event_type: str or str + :ivar decisions: Questions evaluated using the current transcript and the session's shared + Decision items. Required. + :vartype decisions: ~azure.ai.projects.models.LiveDecisionQuestionsInputParam_2 """ - format: Optional["_models.LiveAudioFormat"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. - WebRTC and SIP negotiate their media format separately.""" - output: Optional["_models.LiveInitialSessionAudioOutputParam"] = rest_field( + type: Literal["decisions"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"decisions\".""" + event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The voice used for speech generated by the Live model.""" + """Required. Is either a Literal[\"session.input_transcript.delta\"] type or a + Literal[\"session.output_transcript.delta\"] type.""" + decisions: "_models.LiveDecisionQuestionsInputParam_2" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Questions evaluated using the current transcript and the session's shared Decision items. + Required.""" @overload def __init__( self, *, - format: Optional["_models.LiveAudioFormat"] = None, - output: Optional["_models.LiveInitialSessionAudioOutputParam"] = None, + event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"], + decisions: "_models.LiveDecisionQuestionsInputParam_2", ) -> None: ... @overload @@ -14679,29 +14729,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["decisions"] = "decisions" -class LiveInitialTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Assistant text supplied as conversation history when starting a Live session. +class LiveDelegationReasoningInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning options for Responses requests made on behalf of the Live session. - :ivar type: The text content type. Always ``text``. Default value is "text". - :vartype type: str - :ivar text: The message text to include in the Live session’s initial conversation history. - Required. - :vartype text: str + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.LiveReasoningEffort + :ivar summary: Known values are: "concise", "detailed", and "auto". + :vartype summary: str or ~azure.ai.projects.models.LiveReasoningSummary """ - type: Optional[Literal["text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text content type. Always ``text``. Default value is \"text\".""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The message text to include in the Live session’s initial conversation history. Required.""" + effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"concise\", \"detailed\", and \"auto\".""" @overload def __init__( self, *, - text: str, - type: Optional[Literal["text"]] = None, + effort: Optional[Union[str, "_models.LiveReasoningEffort"]] = None, + summary: Optional[Union[str, "_models.LiveReasoningSummary"]] = None, ) -> None: ... @overload @@ -14715,47 +14769,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveInitialUserMessageItemParam( - LiveInitialItem, discriminator="user" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A user message included in the initial text history of a Live session. +class LiveDelegationTextInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Text generation options for the Live session’s Responses backend. - :ivar id: - :vartype id: str - :ivar type: The history item type. Always ``message``. Default value is "message". - :vartype type: str - :ivar status: Known values are: "incomplete" and "completed". - :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus - :ivar role: The author of this history message. Always ``user``. Required. USER. - :vartype role: str or ~azure.ai.projects.models.USER - :ivar content: The message content. Supply exactly one text part for the initial Live - conversation history. Required. - :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] + :ivar verbosity: Known values are: "low", "medium", and "high". + :vartype verbosity: str or ~azure.ai.projects.models.LiveTextVerbosity """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The history item type. Always ``message``. Default value is \"message\".""" - status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"incomplete\" and \"completed\".""" - role: Literal[LiveInitialItemType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The author of this history message. Always ``user``. Required. USER.""" - content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The message content. Supply exactly one text part for the initial Live conversation history. - Required.""" + """Known values are: \"low\", \"medium\", and \"high\".""" @overload def __init__( self, *, - content: list["_models.LiveInitialInputTextContentPartParam"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[Literal["message"]] = None, - status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, + verbosity: Optional[Union[str, "_models.LiveTextVerbosity"]] = None, ) -> None: ... @overload @@ -14767,50 +14797,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = LiveInitialItemType.USER # type: ignore -class LiveServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An event sent by the Live API on a primary WebSocket or sideband connection. +class LiveFileSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveFileSearchToolInputParam. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - LiveServerEventLiveErrorEvent, LiveServerEventLiveInfoEvent, LiveServerEventLiveResponseEvent, - LiveServerEventLiveSessionClosed, LiveServerEventLiveCommentaryAppended, - LiveServerEventLiveDelegationCreated, LiveInputAudioAppend, LiveServerEventLiveInputAudioMuted, - LiveServerEventLiveInputAudioUnmuted, LiveServerEventLiveInputTranscriptDelta, - LiveServerEventLiveInstructionsAppended, LiveOutputAudioDelta, - LiveServerEventLiveOutputTranscriptDelta, LiveServerEventLiveSessionStarted, - LiveServerEventLiveThinkingAppended, LiveServerEventLiveSessionUpdated, - LiveServerEventLiveSessionUsageUpdated, LiveTransportAnswered, LiveTransportDTMFReceived, - LiveTransportDTMFSend, LiveTransportFailed, LiveTransportRinging + :ivar type: Required. Default value is "file_search". + :vartype type: str + """ - :ivar type: Required. Known values are: "session.started", "session.updated", - "session.input_audio.muted", "session.input_audio.unmuted", "session.instructions.appended", - "session.thinking.appended", "session.commentary.appended", "session.input_audio.append", - "session.output_audio.delta", "session.input_transcript.delta", - "session.output_transcript.delta", "session.delegation.created", "response.event", - "session.usage.updated", "session.closed", "error", "info", "transport.dtmf.received", - "transport.dtmf.send", "transport.ringing", "transport.answered", and "transport.failed". - :vartype type: str or ~azure.ai.projects.models.LiveServerEventType + type: Literal["file_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"file_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["file_search"] = "file_search" + + +class LiveFunctionToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveFunctionToolChoiceParam. + + :ivar type: The tool to call. Always ``function``. Required. Default value is "function". + :vartype type: str + :ivar name: The name of the function tool to call. Required. + :vartype name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"session.started\", \"session.updated\", - \"session.input_audio.muted\", \"session.input_audio.unmuted\", - \"session.instructions.appended\", \"session.thinking.appended\", - \"session.commentary.appended\", \"session.input_audio.append\", - \"session.output_audio.delta\", \"session.input_transcript.delta\", - \"session.output_transcript.delta\", \"session.delegation.created\", \"response.event\", - \"session.usage.updated\", \"session.closed\", \"error\", \"info\", - \"transport.dtmf.received\", \"transport.dtmf.send\", \"transport.ringing\", - \"transport.answered\", and \"transport.failed\".""" + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``function``. Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function tool to call. Required.""" @overload def __init__( self, *, - type: str, + name: str, ) -> None: ... @overload @@ -14822,35 +14844,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["function"] = "function" -class LiveInputAudioAppend( - LiveServerEvent, discriminator="session.input_audio.append" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio received from the primary transport and reflected to a Live sideband connection - before model-input muting. +class LiveFunctionToolInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A function tool available to the Responses backend when the Live model delegates a task. - :ivar type: The event type, always ``session.input_audio.append``. Required. - SESSION_INPUT_AUDIO_APPEND. - :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_APPEND - :ivar audio: Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, - reflected to the sideband before model-input muting. This server event uses the same audio key - as the client command, but is not an acknowledgment of it. Required. - :vartype audio: str + :ivar type: The tool type. Always ``function``. Required. Default value is "function". + :vartype type: str + :ivar name: The name the delegated Responses model uses when calling this function. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: dict[str, any] + :ivar strict: + :vartype strict: bool """ - type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.input_audio.append``. Required. SESSION_INPUT_AUDIO_APPEND.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, reflected to the - sideband before model-input muting. This server event uses the same audio key as the client - command, but is not an acknowledgment of it. Required.""" + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool type. Always ``function``. Required. Default value is \"function\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name the delegated Responses model uses when calling this function. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - audio: str, + name: str, + description: Optional[str] = None, + parameters: Optional[dict[str, Any]] = None, + strict: Optional[bool] = None, ) -> None: ... @overload @@ -14862,48 +14889,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_INPUT_AUDIO_APPEND # type: ignore + self.type: Literal["function"] = "function" -class LiveLiveError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Details of an error encountered by the Live session, including the affected parameter or client - command when available. +class LiveHostedShellContainerAutoParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveHostedShellContainerAutoParam. - :ivar type: The category of error, such as ``invalid_request_error`` for an invalid Live client - command. Required. + :ivar type: Automatically creates a container for this request. Required. Default value is + "container_auto". :vartype type: str - :ivar code: A machine-readable code identifying the Live error, such as ``unknown_parameter``. - Required. - :vartype code: str - :ivar message: A human-readable explanation of the Live error. Required. - :vartype message: str - :ivar param: The parameter that caused the error, when applicable, such as ``session.voice``. - :vartype param: str - :ivar client_event_id: The event_id of the client command that caused the error, when supplied. - :vartype client_event_id: str - """ - - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The category of error, such as ``invalid_request_error`` for an invalid Live client command. - Required.""" - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A machine-readable code identifying the Live error, such as ``unknown_parameter``. Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable explanation of the Live error. Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parameter that caused the error, when applicable, such as ``session.voice``.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command that caused the error, when supplied.""" + :ivar file_ids: + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: str or ~azure.ai.projects.models.LiveContainerMemoryLimit + :ivar network_policy: Is either a LiveContainerNetworkPolicyDisabledParam type or a + LiveHostedShellNetworkPolicyAllowlistParam type. + :vartype network_policy: ~azure.ai.projects.models.LiveContainerNetworkPolicyDisabledParam or + ~azure.ai.projects.models.LiveHostedShellNetworkPolicyAllowlistParam + :ivar skills: + :vartype skills: list[~azure.ai.projects.models.LiveSkillReferenceParam or + ~azure.ai.projects.models.LiveInlineSkillParam] + """ + + type: Literal["container_auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Automatically creates a container for this request. Required. Default value is + \"container_auto\".""" + file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + memory_limit: Optional[Union[str, "_models.LiveContainerMemoryLimit"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + network_policy: Optional[ + Union["_models.LiveContainerNetworkPolicyDisabledParam", "_models.LiveHostedShellNetworkPolicyAllowlistParam"] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a LiveContainerNetworkPolicyDisabledParam type or a + LiveHostedShellNetworkPolicyAllowlistParam type.""" + skills: Optional[list[Union["_models.LiveSkillReferenceParam", "_models.LiveInlineSkillParam"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - type: str, - code: str, - message: str, - param: Optional[str] = None, - client_event_id: Optional[str] = None, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.LiveContainerMemoryLimit"]] = None, + network_policy: Optional[ + Union[ + "_models.LiveContainerNetworkPolicyDisabledParam", "_models.LiveHostedShellNetworkPolicyAllowlistParam" + ] + ] = None, + skills: Optional[list[Union["_models.LiveSkillReferenceParam", "_models.LiveInlineSkillParam"]]] = None, ) -> None: ... @overload @@ -14915,32 +14951,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["container_auto"] = "container_auto" -class LiveMCPToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LiveMCPToolChoiceParam. +class LiveHostedShellNetworkPolicyAllowlistParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """LiveHostedShellNetworkPolicyAllowlistParam. - :ivar type: Required. Default value is "mcp". + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. Default value is "allowlist". :vartype type: str - :ivar server_label: Required. - :vartype server_label: str - :ivar name: Required. - :vartype name: str + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] """ - type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"mcp\".""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["allowlist"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + Default value is \"allowlist\".""" + allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of allowed domains when type is ``allowlist``. Required.""" @overload def __init__( self, *, - server_label: str, - name: str, + allowed_domains: list[str], ) -> None: ... @overload @@ -14952,50 +14988,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["mcp"] = "mcp" + self.type: Literal["allowlist"] = "allowlist" -class LiveOutputAudioDelta( - LiveServerEvent, discriminator="session.output_audio.delta" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in - delivery order using the configured session audio format. Sideband connections receive - reflected output audio with timestamps. +class LiveHostedShellToolInputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Responses shell tool. Use a hosted container or return local shell results with + response.item.create. Domain secrets are not supported. - :ivar type: The event type, always ``session.output_audio.delta``. Required. - SESSION_OUTPUT_AUDIO_DELTA. - :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_DELTA - :ivar delta: Base64-encoded raw audio. Primary WebSocket events use the session's configured - format; reflected sideband events use mono PCM16LE at 24 kHz. Required. - :vartype delta: str - :ivar start_ms: Inclusive session-relative start in milliseconds. Required on reflected - sideband events; omitted on the primary WebSocket. - :vartype start_ms: int - :ivar end_ms: Exclusive session-relative end in milliseconds. Required on reflected sideband - events; omitted on the primary WebSocket. Dropped output frames leave gaps between reflected - ranges. - :vartype end_ms: int + :ivar type: Required. Default value is "shell". + :vartype type: str + :ivar environment: Is one of the following types: LiveHostedShellContainerAutoParam, + LiveContainerReferenceParam, LiveLocalEnvironmentParam + :vartype environment: ~azure.ai.projects.models.LiveHostedShellContainerAutoParam or + ~azure.ai.projects.models.LiveContainerReferenceParam or + ~azure.ai.projects.models.LiveLocalEnvironmentParam """ - type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.output_audio.delta``. Required. SESSION_OUTPUT_AUDIO_DELTA.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded raw audio. Primary WebSocket events use the session's configured format; - reflected sideband events use mono PCM16LE at 24 kHz. Required.""" - start_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inclusive session-relative start in milliseconds. Required on reflected sideband events; - omitted on the primary WebSocket.""" - end_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Exclusive session-relative end in milliseconds. Required on reflected sideband events; omitted - on the primary WebSocket. Dropped output frames leave gaps between reflected ranges.""" + type: Literal["shell"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"shell\".""" + environment: Optional[ + Union[ + "_models.LiveHostedShellContainerAutoParam", + "_models.LiveContainerReferenceParam", + "_models.LiveLocalEnvironmentParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: LiveHostedShellContainerAutoParam, LiveContainerReferenceParam, + LiveLocalEnvironmentParam""" @overload def __init__( self, *, - delta: str, - start_ms: Optional[int] = None, - end_ms: Optional[int] = None, + environment: Optional[ + Union[ + "_models.LiveHostedShellContainerAutoParam", + "_models.LiveContainerReferenceParam", + "_models.LiveLocalEnvironmentParam", + ] + ] = None, ) -> None: ... @overload @@ -15007,36 +15038,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA # type: ignore + self.type: Literal["shell"] = "shell" -class LiveResponsesDelegationParam( - Delegation, discriminator="responses" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Delegate tasks to a Responses model managed by the Live session. +class LiveImageGenerationToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveImageGenerationToolInputParam. - :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. - Required. RESPONSES. - :vartype type: str or ~azure.ai.projects.models.RESPONSES - :ivar responses: Backend model, prompt, and tools used when the Live session delegates a task - to Responses. Required. - :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam + :ivar type: Required. Default value is "image_generation". + :vartype type: str """ - type: Literal[DelegationType.RESPONSES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. - RESPONSES.""" - responses: "_models.LiveResponsesDelegationSettingsInputParam" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Backend model, prompt, and tools used when the Live session delegates a task to Responses. - Required.""" + type: Literal["image_generation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"image_generation\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["image_generation"] = "image_generation" + + +class LiveInitialItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A developer, user, or assistant message supplied as text history before the Live session + starts. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveInitialAssistantMessageItemParam, LiveInitialDeveloperMessageItemParam, + LiveInitialUserMessageItemParam + + :ivar role: Required. Known values are: "developer", "user", and "assistant". + :vartype role: str or ~azure.ai.projects.models.LiveInitialItemType + """ + + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"developer\", \"user\", and \"assistant\".""" @overload def __init__( self, *, - responses: "_models.LiveResponsesDelegationSettingsInputParam", + role: str, ) -> None: ... @overload @@ -15048,93 +15088,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DelegationType.RESPONSES # type: ignore -class LiveResponsesDelegationSettingsInputParam( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Model, prompt, and tool settings for tasks delegated by the Live session to a Responses - backend. +class LiveInitialAssistantMessageItemParam( + LiveInitialItem, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An assistant message included in the initial text history of a Live session. - :ivar model: The model used for server-owned Responses delegations. Required. - :vartype model: str - :ivar instructions: - :vartype instructions: str - :ivar max_output_tokens: - :vartype max_output_tokens: int - :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", - "priority", and "ultrafast". - :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier - :ivar reasoning: - :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam - :ivar text: - :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam - :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the - Live model. - :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or - ~azure.ai.projects.models.LiveWebSearchToolInputParam] - :ivar tool_choice: Controls which tool the Responses backend uses when handling a task - delegated by the Live model. Is one of the following types: Union[str, - "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam - :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or - ~azure.ai.projects.models.LiveFunctionToolChoiceParam or - ~azure.ai.projects.models.LiveMCPToolChoiceParam - :ivar parallel_tool_calls: - :vartype parallel_tool_calls: bool + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``assistant``. Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialTextContentPartParam or + ~azure.ai.projects.models.LiveInitialOutputTextContentPartParam] """ - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model used for server-owned Responses delegations. Required.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and - \"ultrafast\".""" - reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - tools: Optional[list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]]] = ( + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``assistant``. Required. ASSISTANT.""" + content: list[Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"]] = ( rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" - tool_choice: Optional[ - Union[ - str, "_models.LiveToolChoiceEnum", "_models.LiveFunctionToolChoiceParam", "_models.LiveMCPToolChoiceParam" - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Controls which tool the Responses backend uses when handling a task delegated by the Live - model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], - LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" @overload def __init__( self, *, - model: str, - instructions: Optional[str] = None, - max_output_tokens: Optional[int] = None, - service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, - reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, - text: Optional["_models.LiveDelegationTextInputParam"] = None, - tools: Optional[ - list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]] - ] = None, - tool_choice: Optional[ - Union[ - str, - "_models.LiveToolChoiceEnum", - "_models.LiveFunctionToolChoiceParam", - "_models.LiveMCPToolChoiceParam", - ] - ] = None, - parallel_tool_calls: Optional[bool] = None, + content: list[ + Union["_models.LiveInitialTextContentPartParam", "_models.LiveInitialOutputTextContentPartParam"] + ], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, ) -> None: ... @overload @@ -15146,94 +15145,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.ASSISTANT # type: ignore -class LiveResponsesDelegationSettingsUpdateInputParam( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Updates to the Responses backend of an existing Live session. Omitted settings retain their - current values. +class LiveInitialDeveloperMessageItemParam( + LiveInitialItem, discriminator="developer" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A developer message included in the initial text history of a Live session. - :ivar model: The Responses backend model to use for subsequent delegated requests. Omit to keep - the current backend model. - :vartype model: str - :ivar instructions: - :vartype instructions: str - :ivar max_output_tokens: - :vartype max_output_tokens: int - :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", - "priority", and "ultrafast". - :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier - :ivar reasoning: - :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam - :ivar text: - :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam - :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the - Live model. - :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or - ~azure.ai.projects.models.LiveWebSearchToolInputParam] - :ivar tool_choice: Controls which tool the Responses backend uses when handling a task - delegated by the Live model. Is one of the following types: Union[str, - "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam - :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or - ~azure.ai.projects.models.LiveFunctionToolChoiceParam or - ~azure.ai.projects.models.LiveMCPToolChoiceParam - :ivar parallel_tool_calls: - :vartype parallel_tool_calls: bool + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``developer``. Required. DEVELOPER. + :vartype role: str or ~azure.ai.projects.models.DEVELOPER + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] """ - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Responses backend model to use for subsequent delegated requests. Omit to keep the current - backend model.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and - \"ultrafast\".""" - reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.DEVELOPER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``developer``. Required. DEVELOPER.""" + content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - tools: Optional[list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" - tool_choice: Optional[ - Union[ - str, "_models.LiveToolChoiceEnum", "_models.LiveFunctionToolChoiceParam", "_models.LiveMCPToolChoiceParam" - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Controls which tool the Responses backend uses when handling a task delegated by the Live - model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], - LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" @overload def __init__( self, *, - model: Optional[str] = None, - instructions: Optional[str] = None, - max_output_tokens: Optional[int] = None, - service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, - reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, - text: Optional["_models.LiveDelegationTextInputParam"] = None, - tools: Optional[ - list[Union["_models.LiveFunctionToolInputParam", "_models.LiveWebSearchToolInputParam"]] - ] = None, - tool_choice: Optional[ - Union[ - str, - "_models.LiveToolChoiceEnum", - "_models.LiveFunctionToolChoiceParam", - "_models.LiveMCPToolChoiceParam", - ] - ] = None, - parallel_tool_calls: Optional[bool] = None, + content: list["_models.LiveInitialInputTextContentPartParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, ) -> None: ... @overload @@ -15245,33 +15200,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.role = LiveInitialItemType.DEVELOPER # type: ignore -class LiveResponsesDelegationUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Update the Responses backend for an existing Live session without changing delegation - ownership. +class LiveInitialInputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Text supplied in a developer or user message when starting a Live session. - :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. - Required. Default value is "responses". + :ivar type: The text content type. Always ``input_text``. Default value is "input_text". :vartype type: str - :ivar responses: Responses backend settings to update. Omitted settings keep their existing - values. - :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str """ - type: Literal["responses"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. - Default value is \"responses\".""" - responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Responses backend settings to update. Omitted settings keep their existing values.""" + type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``input_text``. Default value is \"input_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" @overload def __init__( self, *, - responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = None, + text: str, + type: Optional[Literal["input_text"]] = None, ) -> None: ... @overload @@ -15283,53 +15235,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["responses"] = "responses" -class LiveServerEventLiveCommentaryAppended( - LiveServerEvent, discriminator="session.commentary.appended" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session.commentary.append command is accepted into the Live session timeline. - Acknowledges the added commentary without guaranteeing exact wording or completed audio - playback. +class LiveInitialOutputTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Assistant output text supplied as conversation history when starting a Live session. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the - beginning of the session. Required. - :vartype start_ms: int - :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the - beginning of the session. For appended context, this can equal start_ms. Required. - :vartype end_ms: int - :ivar type: The event type, always ``session.commentary.appended``. Required. - SESSION_COMMENTARY_APPENDED. - :vartype type: str or ~azure.ai.projects.models.SESSION_COMMENTARY_APPENDED + :ivar type: The text content type. Always ``output_text``. Required. Default value is + "output_text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. + Required. + :vartype text: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The start of this event on the Live session timeline, in milliseconds from the beginning of the - session. Required.""" - end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The end of this event on the Live session timeline, in milliseconds from the beginning of the - session. For appended context, this can equal start_ms. Required.""" - type: Literal[LiveServerEventType.SESSION_COMMENTARY_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.commentary.appended``. Required. SESSION_COMMENTARY_APPENDED.""" + type: Literal["output_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``output_text``. Required. Default value is \"output_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" @overload def __init__( self, *, - event_id: str, - start_ms: int, - end_ms: int, - client_event_id: Optional[str] = None, + text: str, ) -> None: ... @overload @@ -15341,55 +15269,116 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_COMMENTARY_APPENDED # type: ignore + self.type: Literal["output_text"] = "output_text" -class LiveServerEventLiveDelegationCreated( - LiveServerEvent, discriminator="session.delegation.created" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the Live model delegates work to your application or a Responses backend. - Contains delegation metadata and the position on the session timeline where the work was - delegated. +class LiveInitialSessionAudioOutputParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Settings for speech generated by the Live model. Choose the voice before starting the session. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``session.delegation.created``. Required. - SESSION_DELEGATION_CREATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_DELEGATION_CREATED - :ivar offset_ms: The position on the Live session timeline where the delegation was created, in - milliseconds from the beginning of the session. Required. - :vartype offset_ms: int - :ivar delegation: The delegated work identifier and destination. This object contains metadata, - not the task text. Required. - :vartype delegation: ~azure.ai.projects.models.VoiceAgentLiveDelegationItem + :ivar voice: The voice used for Live speech, as a built-in voice name or a custom voice object + containing its ID. Defaults to ``marin`` and cannot change after startup. Is one of the + following types: str, Literal["alloy"], Literal["ash"], Literal["ballad"], Literal["beacon"], + Literal["bossa"], Literal["brise"], Literal["cedar"], Literal["cinder"], Literal["coral"], + Literal["delta"], Literal["echo"], Literal["flitz"], Literal["gleam"], Literal["harema"], + Literal["juni"], Literal["marin"], Literal["meridian"], Literal["nira"], Literal["noeul"], + Literal["nuri"], Literal["quartz"], Literal["ripple"], Literal["sage"], Literal["shida"], + Literal["shimmer"], Literal["sillage"], Literal["stone"], Literal["tempo"], Literal["verse"], + Literal["vesper"], Literal["willow"], LiveCustomVoiceParam + :vartype voice: str or str or str or str or str or str or str or str or str or str or str or + str or str or str or str or str or str or str or str or str or str or str or str or str or str + or str or str or str or str or str or str or str or + ~azure.ai.projects.models.LiveCustomVoiceParam """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.delegation.created``. Required. SESSION_DELEGATION_CREATED.""" - offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The position on the Live session timeline where the delegation was created, in milliseconds - from the beginning of the session. Required.""" - delegation: "_models.VoiceAgentLiveDelegationItem" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The delegated work identifier and destination. This object contains metadata, not the task - text. Required.""" + voice: Optional[ + Union[ + str, + Literal["alloy"], + Literal["ash"], + Literal["ballad"], + Literal["beacon"], + Literal["bossa"], + Literal["brise"], + Literal["cedar"], + Literal["cinder"], + Literal["coral"], + Literal["delta"], + Literal["echo"], + Literal["flitz"], + Literal["gleam"], + Literal["harema"], + Literal["juni"], + Literal["marin"], + Literal["meridian"], + Literal["nira"], + Literal["noeul"], + Literal["nuri"], + Literal["quartz"], + Literal["ripple"], + Literal["sage"], + Literal["shida"], + Literal["shimmer"], + Literal["sillage"], + Literal["stone"], + Literal["tempo"], + Literal["verse"], + Literal["vesper"], + Literal["willow"], + "_models.LiveCustomVoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice used for Live speech, as a built-in voice name or a custom voice object containing + its ID. Defaults to ``marin`` and cannot change after startup. Is one of the following types: + str, Literal[\"alloy\"], Literal[\"ash\"], Literal[\"ballad\"], Literal[\"beacon\"], + Literal[\"bossa\"], Literal[\"brise\"], Literal[\"cedar\"], Literal[\"cinder\"], + Literal[\"coral\"], Literal[\"delta\"], Literal[\"echo\"], Literal[\"flitz\"], + Literal[\"gleam\"], Literal[\"harema\"], Literal[\"juni\"], Literal[\"marin\"], + Literal[\"meridian\"], Literal[\"nira\"], Literal[\"noeul\"], Literal[\"nuri\"], + Literal[\"quartz\"], Literal[\"ripple\"], Literal[\"sage\"], Literal[\"shida\"], + Literal[\"shimmer\"], Literal[\"sillage\"], Literal[\"stone\"], Literal[\"tempo\"], + Literal[\"verse\"], Literal[\"vesper\"], Literal[\"willow\"], LiveCustomVoiceParam""" @overload def __init__( self, *, - event_id: str, - offset_ms: int, - delegation: "_models.VoiceAgentLiveDelegationItem", - client_event_id: Optional[str] = None, + voice: Optional[ + Union[ + str, + Literal["alloy"], + Literal["ash"], + Literal["ballad"], + Literal["beacon"], + Literal["bossa"], + Literal["brise"], + Literal["cedar"], + Literal["cinder"], + Literal["coral"], + Literal["delta"], + Literal["echo"], + Literal["flitz"], + Literal["gleam"], + Literal["harema"], + Literal["juni"], + Literal["marin"], + Literal["meridian"], + Literal["nira"], + Literal["noeul"], + Literal["nuri"], + Literal["quartz"], + Literal["ripple"], + Literal["sage"], + Literal["shida"], + Literal["shimmer"], + Literal["sillage"], + Literal["stone"], + Literal["tempo"], + Literal["verse"], + Literal["vesper"], + Literal["willow"], + "_models.LiveCustomVoiceParam", + ] + ] = None, ) -> None: ... @overload @@ -15401,43 +15390,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_DELEGATION_CREATED # type: ignore -class LiveServerEventLiveErrorEvent( - LiveServerEvent, discriminator="error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reports an error in the Live session, such as an invalid client command. Use - error.client_event_id, when present, to identify the command that caused the error. +class LiveInitialSessionAudioParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``error``. Required. ERROR. - :vartype type: str or ~azure.ai.projects.models.ERROR - :ivar error: Details of the Live error and the client command that caused it, when known. - Required. - :vartype error: ~azure.ai.projects.models.LiveLiveError + :ivar format: Audio encoding and sample rate for audio sent and received over a Live WebSocket + connection. WebRTC and SIP negotiate their media format separately. + :vartype format: ~azure.ai.projects.models.LiveAudioFormat + :ivar output: The voice used for speech generated by the Live model. + :vartype output: ~azure.ai.projects.models.LiveInitialSessionAudioOutputParam """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``error``. Required. ERROR.""" - error: "_models.LiveLiveError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Details of the Live error and the client command that caused it, when known. Required.""" + format: Optional["_models.LiveAudioFormat"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. + WebRTC and SIP negotiate their media format separately.""" + output: Optional["_models.LiveInitialSessionAudioOutputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The voice used for speech generated by the Live model.""" @overload def __init__( self, *, - event_id: str, - error: "_models.LiveLiveError", - client_event_id: Optional[str] = None, + format: Optional["_models.LiveAudioFormat"] = None, + output: Optional["_models.LiveInitialSessionAudioOutputParam"] = None, ) -> None: ... @overload @@ -15449,48 +15428,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.ERROR # type: ignore -class LiveServerEventLiveInfoEvent( - LiveServerEvent, discriminator="info" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An informational notice about the Live session, such as the event permissions applied to a - frontend data channel. +class LiveInitialTextContentPartParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Assistant text supplied as conversation history when starting a Live session. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``info``. Required. INFO. - :vartype type: str or ~azure.ai.projects.models.INFO - :ivar code: A machine-readable code for the notice, such as ``data_channel_permissions``. + :ivar type: The text content type. Always ``text``. Default value is "text". + :vartype type: str + :ivar text: The message text to include in the Live session’s initial conversation history. Required. - :vartype code: str - :ivar message: A human-readable explanation of the Live session notice. Required. - :vartype message: str + :vartype text: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.INFO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``info``. Required. INFO.""" - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A machine-readable code for the notice, such as ``data_channel_permissions``. Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable explanation of the Live session notice. Required.""" + type: Optional[Literal["text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content type. Always ``text``. Default value is \"text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The message text to include in the Live session’s initial conversation history. Required.""" @overload def __init__( self, *, - event_id: str, - code: str, - message: str, - client_event_id: Optional[str] = None, + text: str, + type: Optional[Literal["text"]] = None, ) -> None: ... @overload @@ -15502,38 +15462,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.INFO # type: ignore -class LiveServerEventLiveInputAudioMuted( - LiveServerEvent, discriminator="session.input_audio.muted" +class LiveInitialUserMessageItemParam( + LiveInitialItem, discriminator="user" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session.input_audio.mute command is accepted. Input audio is no longer sent to - the model; sideband audio reflection continues. + """A user message included in the initial text history of a Live session. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``session.input_audio.muted``. Required. - SESSION_INPUT_AUDIO_MUTED. - :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_MUTED + :ivar id: + :vartype id: str + :ivar type: The history item type. Always ``message``. Default value is "message". + :vartype type: str + :ivar status: Known values are: "incomplete" and "completed". + :vartype status: str or ~azure.ai.projects.models.LiveInitialMessageStatus + :ivar role: The author of this history message. Always ``user``. Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER + :ivar content: The message content. Supply exactly one text part for the initial Live + conversation history. Required. + :vartype content: list[~azure.ai.projects.models.LiveInitialInputTextContentPartParam] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_MUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.input_audio.muted``. Required. SESSION_INPUT_AUDIO_MUTED.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[Literal["message"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The history item type. Always ``message``. Default value is \"message\".""" + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"incomplete\" and \"completed\".""" + role: Literal[LiveInitialItemType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The author of this history message. Always ``user``. Required. USER.""" + content: list["_models.LiveInitialInputTextContentPartParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The message content. Supply exactly one text part for the initial Live conversation history. + Required.""" @overload def __init__( self, *, - event_id: str, - client_event_id: Optional[str] = None, + content: list["_models.LiveInitialInputTextContentPartParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[Literal["message"]] = None, + status: Optional[Union[str, "_models.LiveInitialMessageStatus"]] = None, ) -> None: ... @overload @@ -15545,38 +15516,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_INPUT_AUDIO_MUTED # type: ignore + self.role = LiveInitialItemType.USER # type: ignore -class LiveServerEventLiveInputAudioUnmuted( - LiveServerEvent, discriminator="session.input_audio.unmuted" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session.input_audio.unmute command is accepted. Input audio is sent to the - model again. +class LiveInlineSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveInlineSkillParam. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``session.input_audio.unmuted``. Required. - SESSION_INPUT_AUDIO_UNMUTED. - :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_UNMUTED + :ivar type: Defines an inline skill for this request. Required. Default value is "inline". + :vartype type: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar source: Inline skill payload. Required. + :vartype source: ~azure.ai.projects.models.LiveInlineSkillSourceParam """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.input_audio.unmuted``. Required. SESSION_INPUT_AUDIO_UNMUTED.""" + type: Literal["inline"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Defines an inline skill for this request. Required. Default value is \"inline\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + source: "_models.LiveInlineSkillSourceParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Inline skill payload. Required.""" @overload def __init__( self, *, - event_id: str, - client_event_id: Optional[str] = None, + name: str, + description: str, + source: "_models.LiveInlineSkillSourceParam", ) -> None: ... @overload @@ -15588,60 +15561,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED # type: ignore + self.type: Literal["inline"] = "inline" -class LiveServerEventLiveInputTranscriptDelta( - LiveServerEvent, discriminator="session.input_transcript.delta" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A transcript fragment for user input audio in the Live session. Accumulate fragments in - delivery order; these events do not define complete turns or include a transcript-done event. +class LiveInlineSkillSourceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline skill payload. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the - beginning of the session. Required. - :vartype start_ms: int - :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the - beginning of the session. For appended context, this can equal start_ms. Required. - :vartype end_ms: int - :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in - delivery order to build the transcript. Required. - :vartype delta: str - :ivar type: The event type, always ``session.input_transcript.delta``. Required. - SESSION_INPUT_TRANSCRIPT_DELTA. - :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_TRANSCRIPT_DELTA + :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is + "base64". + :vartype type: str + :ivar media_type: The media type of the inline skill payload. Must be ``application/zip``. + Required. Default value is "application/zip". + :vartype media_type: str + :ivar data: Base64-encoded skill zip bundle. Required. + :vartype data: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The start of this event on the Live session timeline, in milliseconds from the beginning of the - session. Required.""" - end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The end of this event on the Live session timeline, in milliseconds from the beginning of the - session. For appended context, this can equal start_ms. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcript text fragment for the audio in this time range. Append fragments in delivery - order to build the transcript. Required.""" - type: Literal[LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.input_transcript.delta``. Required. - SESSION_INPUT_TRANSCRIPT_DELTA.""" + type: Literal["base64"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the inline skill source. Must be ``base64``. Required. Default value is \"base64\".""" + media_type: Literal["application/zip"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The media type of the inline skill payload. Must be ``application/zip``. Required. Default + value is \"application/zip\".""" + data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded skill zip bundle. Required.""" @overload def __init__( self, *, - event_id: str, - start_ms: int, - end_ms: int, - delta: str, - client_event_id: Optional[str] = None, + data: str, ) -> None: ... @overload @@ -15653,53 +15601,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA # type: ignore + self.type: Literal["base64"] = "base64" + self.media_type: Literal["application/zip"] = "application/zip" -class LiveServerEventLiveInstructionsAppended( - LiveServerEvent, discriminator="session.instructions.appended" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session.instructions.append command is accepted into the Live session timeline. - Acknowledges the appended instructions without guaranteeing that the model has acted on them. +class LiveServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An event sent by the Live API on a primary WebSocket or sideband connection. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the - beginning of the session. Required. - :vartype start_ms: int - :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the - beginning of the session. For appended context, this can equal start_ms. Required. - :vartype end_ms: int - :ivar type: The event type, always ``session.instructions.appended``. Required. - SESSION_INSTRUCTIONS_APPENDED. - :vartype type: str or ~azure.ai.projects.models.SESSION_INSTRUCTIONS_APPENDED + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LiveServerEventLiveDecisionEvent, LiveServerEventLiveDecisionItemCreated, + LiveServerEventLiveDecisionItemDeleted, LiveServerEventLiveErrorEvent, + LiveServerEventLiveInfoEvent, LiveServerEventLiveResponseEvent, + LiveServerEventLiveSessionClosed, LiveServerEventLiveCommentaryAppended, + LiveServerEventLiveDelegationCreated, LiveInputAudioAppend, LiveServerEventLiveInputAudioMuted, + LiveServerEventLiveInputAudioUnmuted, LiveServerEventLiveInputTranscriptDelta, + LiveServerEventLiveInstructionsAppended, LiveOutputAudioDelta, + LiveServerEventLiveOutputAudioFixturePlayed, LiveServerEventLiveOutputAudioFixturePlaying, + LiveServerEventLiveOutputTranscriptDelta, LiveServerEventLiveSessionStarted, + LiveServerEventLiveThinkingAppended, LiveServerEventLiveSessionUpdated, + LiveServerEventLiveSessionUsageUpdated, LiveServerEventLiveTransportAnswered, + LiveTransportDTMFReceived, LiveTransportDTMFSend, LiveServerEventLiveTransportFailed, + LiveServerEventLiveTransportRinging + + :ivar type: Required. Known values are: "session.started", "session.updated", + "session.input_audio.muted", "session.input_audio.unmuted", + "session.output_audio.fixture.playing", "session.output_audio.fixture.played", + "session.instructions.appended", "session.thinking.appended", "session.commentary.appended", + "session.input_audio.append", "session.output_audio.delta", "session.input_transcript.delta", + "session.output_transcript.delta", "session.delegation.created", "decision.event", + "decision.item.created", "decision.item.deleted", "response.event", "session.usage.updated", + "session.closed", "error", "info", "transport.dtmf.received", "transport.dtmf.send", + "transport.ringing", "transport.answered", and "transport.failed". + :vartype type: str or ~azure.ai.projects.models.LiveServerEventType """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The start of this event on the Live session timeline, in milliseconds from the beginning of the - session. Required.""" - end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The end of this event on the Live session timeline, in milliseconds from the beginning of the - session. For appended context, this can equal start_ms. Required.""" - type: Literal[LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.instructions.appended``. Required. - SESSION_INSTRUCTIONS_APPENDED.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"session.started\", \"session.updated\", + \"session.input_audio.muted\", \"session.input_audio.unmuted\", + \"session.output_audio.fixture.playing\", \"session.output_audio.fixture.played\", + \"session.instructions.appended\", \"session.thinking.appended\", + \"session.commentary.appended\", \"session.input_audio.append\", + \"session.output_audio.delta\", \"session.input_transcript.delta\", + \"session.output_transcript.delta\", \"session.delegation.created\", \"decision.event\", + \"decision.item.created\", \"decision.item.deleted\", \"response.event\", + \"session.usage.updated\", \"session.closed\", \"error\", \"info\", + \"transport.dtmf.received\", \"transport.dtmf.send\", \"transport.ringing\", + \"transport.answered\", and \"transport.failed\".""" @overload def __init__( self, *, - event_id: str, - start_ms: int, - end_ms: int, - client_event_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -15711,60 +15665,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED # type: ignore -class LiveServerEventLiveOutputTranscriptDelta( - LiveServerEvent, discriminator="session.output_transcript.delta" +class LiveInputAudioAppend( + LiveServerEvent, discriminator="session.input_audio.append" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A transcript fragment for assistant output audio in the Live session. Accumulate fragments in - delivery order; these events do not define complete turns or include a transcript-done event. + """Input audio received from the primary transport and reflected to a Live sideband connection + before model-input muting. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the - beginning of the session. Required. - :vartype start_ms: int - :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the - beginning of the session. For appended context, this can equal start_ms. Required. - :vartype end_ms: int - :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in - delivery order to build the transcript. Required. - :vartype delta: str - :ivar type: The event type, always ``session.output_transcript.delta``. Required. - SESSION_OUTPUT_TRANSCRIPT_DELTA. - :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_TRANSCRIPT_DELTA + :ivar type: The event type, always ``session.input_audio.append``. Required. + SESSION_INPUT_AUDIO_APPEND. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_APPEND + :ivar audio: Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, + reflected to the sideband before model-input muting. This server event uses the same audio key + as the client command, but is not an acknowledgment of it. Required. + :vartype audio: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The start of this event on the Live session timeline, in milliseconds from the beginning of the - session. Required.""" - end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The end of this event on the Live session timeline, in milliseconds from the beginning of the - session. For appended context, this can equal start_ms. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcript text fragment for the audio in this time range. Append fragments in delivery - order to build the transcript. Required.""" - type: Literal[LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.output_transcript.delta``. Required. - SESSION_OUTPUT_TRANSCRIPT_DELTA.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.append``. Required. SESSION_INPUT_AUDIO_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport, reflected to the + sideband before model-input muting. This server event uses the same audio key as the client + command, but is not an acknowledgment of it. Required.""" @overload def __init__( self, *, - event_id: str, - start_ms: int, - end_ms: int, - delta: str, - client_event_id: Optional[str] = None, + audio: str, ) -> None: ... @overload @@ -15776,50 +15705,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA # type: ignore + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_APPEND # type: ignore -class LiveServerEventLiveResponseEvent( - LiveServerEvent, discriminator="response.event" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A streaming Responses API event from a backend delegated to by the Live session. Use the outer - delegation_id to associate the nested stream with its Live delegation. +class LiveLiveError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of an error encountered by the Live session, including the affected parameter or client + command when available. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. + :ivar type: The category of error, such as ``invalid_request_error`` for an invalid Live client + command. Required. + :vartype type: str + :ivar code: A machine-readable code identifying the Live error, such as ``unknown_parameter``. + Required. + :vartype code: str + :ivar message: A human-readable explanation of the Live error. Required. + :vartype message: str + :ivar param: The parameter that caused the error, when applicable, such as ``session.voice``. + :vartype param: str + :ivar client_event_id: The event_id of the client command that caused the error, when supplied. :vartype client_event_id: str - :ivar type: The event type, always ``response.event``. Required. RESPONSE_EVENT. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_EVENT - :ivar delegation_id: - :vartype delegation_id: str - :ivar event: The nested Responses streaming event. Dispatch on its type field. Response - lifecycle snapshots omit input and clear instructions, tools, and output to keep messages - small; consume granular output events for the generated content. Required. - :vartype event: dict[str, any] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.RESPONSE_EVENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``response.event``. Required. RESPONSE_EVENT.""" - delegation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - event: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The nested Responses streaming event. Dispatch on its type field. Response lifecycle snapshots - omit input and clear instructions, tools, and output to keep messages small; consume granular - output events for the generated content. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The category of error, such as ``invalid_request_error`` for an invalid Live client command. + Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable code identifying the Live error, such as ``unknown_parameter``. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable explanation of the Live error. Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameter that caused the error, when applicable, such as ``session.voice``.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command that caused the error, when supplied.""" @overload def __init__( self, *, - event_id: str, - event: dict[str, Any], + type: str, + code: str, + message: str, + param: Optional[str] = None, client_event_id: Optional[str] = None, - delegation_id: Optional[str] = None, ) -> None: ... @overload @@ -15831,67 +15758,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.RESPONSE_EVENT # type: ignore -class LiveServerEventLiveSessionClosed( - LiveServerEvent, discriminator="session.closed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned after the Live session finishes finalizing, with the close reason, final session - snapshot, and cumulative audio usage. A connection closing without this event does not confirm - successful finalization. +class LiveLocalEnvironmentParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveLocalEnvironmentParam. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``session.closed``. Required. SESSION_CLOSED. - :vartype type: str or ~azure.ai.projects.models.SESSION_CLOSED - :ivar reason: Why the Live session ended: ``close_requested`` for an application close or - hangup request, ``expired`` for the session duration limit, ``content`` for a safety filter, - ``remote_hangup`` for a graceful remote disconnect, or ``connection_lost`` for an unexpected - primary or upstream disconnection. Required. Is one of the following types: - Literal["close_requested"], Literal["expired"], Literal["content"], Literal["remote_hangup"], - Literal["connection_lost"] - :vartype reason: str or str or str or str or str - :ivar session: Required. - :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource - :ivar usage: The final cumulative Live audio usage after session finalization. Required. - :vartype usage: ~azure.ai.projects.models.LiveSessionUsage + :ivar type: Use a local computer environment. Required. Default value is "local". + :vartype type: str + :ivar skills: + :vartype skills: list[~azure.ai.projects.models.LiveLocalSkillParam] """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.SESSION_CLOSED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.closed``. Required. SESSION_CLOSED.""" - reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Why the Live session ended: ``close_requested`` for an application close or hangup request, - ``expired`` for the session duration limit, ``content`` for a safety filter, ``remote_hangup`` - for a graceful remote disconnect, or ``connection_lost`` for an unexpected primary or upstream - disconnection. Required. Is one of the following types: Literal[\"close_requested\"], - Literal[\"expired\"], Literal[\"content\"], Literal[\"remote_hangup\"], - Literal[\"connection_lost\"]""" - session: "_models.VoiceAgentLiveSessionResource" = rest_field( + type: Literal["local"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Use a local computer environment. Required. Default value is \"local\".""" + skills: Optional[list["_models.LiveLocalSkillParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" - usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final cumulative Live audio usage after session finalization. Required.""" @overload def __init__( self, *, - event_id: str, - reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], - session: "_models.VoiceAgentLiveSessionResource", - usage: "_models.LiveSessionUsage", - client_event_id: Optional[str] = None, + skills: Optional[list["_models.LiveLocalSkillParam"]] = None, ) -> None: ... @overload @@ -15903,51 +15791,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_CLOSED # type: ignore + self.type: Literal["local"] = "local" -class LiveServerEventLiveSessionStarted( - LiveServerEvent, discriminator="session.started" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a Live session has started. Contains the resolved session configuration, - including server defaults. +class LiveLocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveLocalSkillParam. - :ivar type: The event type, always ``session.started``. Required. SESSION_STARTED. - :vartype type: str or ~azure.ai.projects.models.SESSION_STARTED - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar session: Required. - :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource - :ivar conversation_id: Stored conversation ID when effective store is true. Use - protocols/voice/live/conversations; this ID differs from session.id. - :vartype conversation_id: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar path: The path to the directory containing the skill. Required. + :vartype path: str """ - type: Literal[LiveServerEventType.SESSION_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.started``. Required. SESSION_STARTED.""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - session: "_models.VoiceAgentLiveSessionResource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Stored conversation ID when effective store is true. Use protocols/voice/live/conversations; - this ID differs from session.id.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the directory containing the skill. Required.""" @overload def __init__( self, *, - event_id: str, - session: "_models.VoiceAgentLiveSessionResource", - client_event_id: Optional[str] = None, - conversation_id: Optional[str] = None, + name: str, + description: str, + path: str, ) -> None: ... @overload @@ -15959,44 +15830,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_STARTED # type: ignore -class LiveServerEventLiveSessionUpdated( - LiveServerEvent, discriminator="session.updated" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a Live session update is accepted. Contains the resolved session configuration - after the update. +class LiveMCPToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveMCPToolChoiceParam. - :ivar type: The event type, always ``session.updated``. Required. SESSION_UPDATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar session: Required. - :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource + :ivar type: The tool to call. Always ``mcp``. Required. Default value is "mcp". + :vartype type: str + :ivar server_label: The label of the MCP server to call. Required. + :vartype server_label: str + :ivar name: + :vartype name: str """ - type: Literal[LiveServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.updated``. Required. SESSION_UPDATED.""" - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - session: "_models.VoiceAgentLiveSessionResource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``mcp``. Required. Default value is \"mcp\".""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server to call. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - session: "_models.VoiceAgentLiveSessionResource", - client_event_id: Optional[str] = None, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -16008,142 +15866,80 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_UPDATED # type: ignore + self.type: Literal["mcp"] = "mcp" -class LiveServerEventLiveSessionUsageUpdated( - LiveServerEvent, discriminator="session.usage.updated" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reports cumulative Live audio usage and, when available, the most recent context-window usage. - Delegated Responses token usage is reported separately in response.event events. +class LiveMCPToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveMCPToolInputParam. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar type: The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_USAGE_UPDATED - :ivar usage: The cumulative Live audio usage so far. Required. - :vartype usage: ~azure.ai.projects.models.LiveSessionUsage - :ivar context_window: The latest measured Live context-window usage. Omitted when the context - limit is unknown. - :vartype context_window: ~azure.ai.projects.models.LiveContextWindowUsage + :ivar type: Required. Default value is "mcp". + :vartype type: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - type: Literal[LiveServerEventType.SESSION_USAGE_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED.""" - usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The cumulative Live audio usage so far. Required.""" - context_window: Optional["_models.LiveContextWindowUsage"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The latest measured Live context-window usage. Omitted when the context limit is unknown.""" - - @overload - def __init__( - self, - *, - event_id: str, - usage: "_models.LiveSessionUsage", - client_event_id: Optional[str] = None, - context_window: Optional["_models.LiveContextWindowUsage"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"mcp\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_USAGE_UPDATED # type: ignore + self.type: Literal["mcp"] = "mcp" -class LiveServerEventLiveThinkingAppended( - LiveServerEvent, discriminator="session.thinking.appended" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session.thinking.append command is accepted into the Live session timeline. - Acknowledges the added reasoning context without guaranteeing any spoken output. +class LiveNamespaceToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveNamespaceToolInputParam. - :ivar event_id: The unique ID of the Live server event. Required. - :vartype event_id: str - :ivar client_event_id: The event_id of the client command associated with this server event, - when supplied. - :vartype client_event_id: str - :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the - beginning of the session. Required. - :vartype start_ms: int - :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the - beginning of the session. For appended context, this can equal start_ms. Required. - :vartype end_ms: int - :ivar type: The event type, always ``session.thinking.appended``. Required. - SESSION_THINKING_APPENDED. - :vartype type: str or ~azure.ai.projects.models.SESSION_THINKING_APPENDED + :ivar type: Required. Default value is "namespace". + :vartype type: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the Live server event. Required.""" - client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client command associated with this server event, when supplied.""" - start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The start of this event on the Live session timeline, in milliseconds from the beginning of the - session. Required.""" - end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The end of this event on the Live session timeline, in milliseconds from the beginning of the - session. For appended context, this can equal start_ms. Required.""" - type: Literal[LiveServerEventType.SESSION_THINKING_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, always ``session.thinking.appended``. Required. SESSION_THINKING_APPENDED.""" - - @overload - def __init__( - self, - *, - event_id: str, - start_ms: int, - end_ms: int, - client_event_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["namespace"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"namespace\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.SESSION_THINKING_APPENDED # type: ignore + self.type: Literal["namespace"] = "namespace" -class LiveSessionAudioFormatPCMAParam( - LiveAudioFormat, discriminator="audio/pcma" +class LiveOutputAudioDelta( + LiveServerEvent, discriminator="session.output_audio.delta" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Raw, mono G.711 A-law audio for a Live WebSocket connection. + """An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in + delivery order using the configured session audio format. Sideband connections receive + reflected output audio with timestamps. - :ivar type: The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA - :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. - :vartype rate: int + :ivar type: The event type, always ``session.output_audio.delta``. Required. + SESSION_OUTPUT_AUDIO_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_DELTA + :ivar delta: Base64-encoded raw audio. Primary WebSocket events use the session's configured + format; reflected sideband events use mono PCM16LE at 24 kHz. Required. + :vartype delta: str + :ivar start_ms: Inclusive session-relative start in milliseconds. Required on reflected + sideband events; omitted on the primary WebSocket. + :vartype start_ms: int + :ivar end_ms: Exclusive session-relative end in milliseconds. Required on reflected sideband + events; omitted on the primary WebSocket. Dropped output frames leave gaps between reflected + ranges. + :vartype end_ms: int """ - type: Literal[LiveAudioFormatType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA.""" - rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.output_audio.delta``. Required. SESSION_OUTPUT_AUDIO_DELTA.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded raw audio. Primary WebSocket events use the session's configured format; + reflected sideband events use mono PCM16LE at 24 kHz. Required.""" + start_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inclusive session-relative start in milliseconds. Required on reflected sideband events; + omitted on the primary WebSocket.""" + end_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Exclusive session-relative end in milliseconds. Required on reflected sideband events; omitted + on the primary WebSocket. Dropped output frames leave gaps between reflected ranges.""" @overload def __init__( self, *, - rate: int, + delta: str, + start_ms: Optional[int] = None, + end_ms: Optional[int] = None, ) -> None: ... @overload @@ -16155,67 +15951,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveAudioFormatType.AUDIO_PCMA # type: ignore + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_DELTA # type: ignore -class LiveSessionAudioFormatPCMParam( - LiveAudioFormat, discriminator="audio/pcm" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Raw, mono 16-bit little-endian PCM audio for a Live WebSocket connection. +class LiveProgrammaticToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveProgrammaticToolInputParam. - :ivar type: The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM - :ivar rate: Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. - Required. Is either a Literal[16000] type or a Literal[24000] type. - :vartype rate: int or int + :ivar type: Required. Default value is "programmatic_tool_calling". + :vartype type: str """ - type: Literal[LiveAudioFormatType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM.""" - rate: Literal[16000, 24000] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. Required. Is - either a Literal[16000] type or a Literal[24000] type.""" - - @overload - def __init__( - self, - *, - rate: Literal[16000, 24000], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["programmatic_tool_calling"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"programmatic_tool_calling\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveAudioFormatType.AUDIO_PCM # type: ignore + self.type: Literal["programmatic_tool_calling"] = "programmatic_tool_calling" -class LiveSessionAudioFormatPCMUParam( - LiveAudioFormat, discriminator="audio/pcmu" +class LiveResponsesDelegationParam( + Delegation, discriminator="responses" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Raw, mono G.711 μ-law audio for a Live WebSocket connection. + """Delegate tasks to a Responses model managed by the Live session. - :ivar type: The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU - :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. - :vartype rate: int + :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. + Required. RESPONSES. + :vartype type: str or ~azure.ai.projects.models.RESPONSES + :ivar responses: Backend model, prompt, and tools used when the Live session delegates a task + to Responses. Required. + :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsInputParam """ - type: Literal[LiveAudioFormatType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU.""" - rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" + type: Literal[DelegationType.RESPONSES] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. + RESPONSES.""" + responses: "_models.LiveResponsesDelegationSettingsInputParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Backend model, prompt, and tools used when the Live session delegates a task to Responses. + Required.""" @overload def __init__( self, *, - rate: int, + responses: "_models.LiveResponsesDelegationSettingsInputParam", ) -> None: ... @overload @@ -16227,73 +16007,180 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveAudioFormatType.AUDIO_PCMU # type: ignore + self.type = DelegationType.RESPONSES # type: ignore -class LiveSessionCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Initial configuration for a Live session, including its model, conversation instructions, - audio, and delegated task handling. +class LiveResponsesDelegationSettingsInputParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Model, prompt, and tool settings for tasks delegated by the Live session to a Responses + backend. - :ivar model: Required. "gpt-live-1" - :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar model: The model used for server-owned Responses delegations. Required. + :vartype model: str :ivar instructions: :vartype instructions: str - :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and - assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in - total. - :vartype input: list[~azure.ai.projects.models.LiveInitialItem] - :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC - and SIP negotiate their media format. Voice and format are immutable after startup. - :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam - :ivar delegation: Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam - type. - :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or - ~azure.ai.projects.models.LiveResponsesDelegationParam - :ivar store: Whether to store the session for later forking and recording download. Defaults to - false for new sessions. - :vartype store: bool - :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC - session. Trusted sideband connections are unaffected. - :vartype client: ~azure.ai.projects.models.LiveClientConfigParam + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", + "priority", and "ultrafast". + :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam + :ivar text: + :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam + :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the + Live model. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or + ~azure.ai.projects.models.LiveWebSearchToolInputParam or + ~azure.ai.projects.models.LiveFileSearchToolInputParam or + ~azure.ai.projects.models.LiveCodeInterpreterToolInputParam or + ~azure.ai.projects.models.LiveHostedShellToolInputParam or + ~azure.ai.projects.models.LiveImageGenerationToolInputParam or + ~azure.ai.projects.models.LiveMCPToolInputParam or + ~azure.ai.projects.models.LiveCustomToolInputParam or + ~azure.ai.projects.models.LiveNamespaceToolInputParam or + ~azure.ai.projects.models.LiveToolSearchToolInputParam or + ~azure.ai.projects.models.LiveProgrammaticToolInputParam or + ~azure.ai.projects.models.LiveComputerToolInputParam or + ~azure.ai.projects.models.LiveApplyPatchToolInputParam] + :ivar tool_choice: Controls which tool the Responses backend uses when handling a task + delegated by the Live model. Is one of the following types: Union[str, + "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, + LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, + LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam + :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or + ~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam or + ~azure.ai.projects.models.LiveSpecificFileSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchPreviewParam or + ~azure.ai.projects.models.LiveSpecificImageGenParam or + ~azure.ai.projects.models.LiveSpecificComputerParam or + ~azure.ai.projects.models.LiveSpecificCodeInterpreterParam or + ~azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam or + ~azure.ai.projects.models.LiveSpecificFunctionShellParam or + ~azure.ai.projects.models.LiveSpecificCustomToolParam or + ~azure.ai.projects.models.LiveSpecificApplyPatchParam or + ~azure.ai.projects.models.LiveAllowedToolsChoiceParam + :ivar parallel_tool_calls: + :vartype parallel_tool_calls: bool """ - model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. \"gpt-live-1\"""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model used for server-owned Responses delegations. Required.""" instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input: Optional[list["_models.LiveInitialItem"]] = rest_field( + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Ordered text-only history supplied before startup. Supports developer, user, and assistant - messages with one text part each; at most 128 messages and 8,192 rendered tokens in total.""" - audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and + \"ultrafast\".""" + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP - negotiate their media format. Voice and format are immutable after startup.""" - delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Is either a LiveClientDelegationParam type or a LiveResponsesDelegationParam type.""" - store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to store the session for later forking and recording download. Defaults to false for - new sessions.""" - client: Optional["_models.LiveClientConfigParam"] = rest_field( + text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. - Trusted sideband connections are unaffected.""" + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Controls which tool the Responses backend uses when handling a task delegated by the Live + model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], + LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, + LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, + LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - model: Union[str, "_models.ModelIdsLive"], + model: str, instructions: Optional[str] = None, - input: Optional[list["_models.LiveInitialItem"]] = None, - audio: Optional["_models.LiveInitialSessionAudioParam"] = None, - delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationParam"]] = None, - store: Optional[bool] = None, - client: Optional["_models.LiveClientConfigParam"] = None, + max_output_tokens: Optional[int] = None, + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, + text: Optional["_models.LiveDelegationTextInputParam"] = None, + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = None, + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = None, + parallel_tool_calls: Optional[bool] = None, ) -> None: ... @overload @@ -16307,72 +16194,179 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveSessionStartEvent( - LiveClientEvent, discriminator="session.start" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Start a Live session on a primary WebSocket. Send this event before other commands and wait for - ``session.started``. - - :ivar event_id: - :vartype event_id: str - :ivar type: The Live client event type. Always ``session.start``. Required. SESSION_START. - :vartype type: str or ~azure.ai.projects.models.SESSION_START - :ivar session: Initial configuration for a primary WebSocket. Send session.start first and wait - for session.started before application commands. WebRTC creation already starts the session; do - not send this event again on its data channel. Required. - :vartype session: ~azure.ai.projects.models.LiveSessionCreateParams - """ - - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[LiveClientEventType.SESSION_START] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Live client event type. Always ``session.start``. Required. SESSION_START.""" - session: "_models.LiveSessionCreateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Initial configuration for a primary WebSocket. Send session.start first and wait for - session.started before application commands. WebRTC creation already starts the session; do not - send this event again on its data channel. Required.""" - - @overload - def __init__( - self, - *, - session: "_models.LiveSessionCreateParams", - event_id: Optional[str] = None, - ) -> None: ... +class LiveResponsesDelegationSettingsUpdateInputParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Updates to the Responses backend of an existing Live session. Omitted settings retain their + current values. - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = LiveClientEventType.SESSION_START # type: ignore - - -class LiveSessionUpdateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Changes to an active Live session. Only delegation backend settings can be updated after - startup. - - :ivar delegation: Is either a LiveClientDelegationParam type or a - LiveResponsesDelegationUpdateParam type. - :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or - ~azure.ai.projects.models.LiveResponsesDelegationUpdateParam + :ivar model: The Responses backend model to use for subsequent delegated requests. Omit to keep + the current backend model. + :vartype model: str + :ivar instructions: + :vartype instructions: str + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar service_tier: Known values are: "auto", "default", "fast_tier_temp_pilot", "flex", + "priority", and "ultrafast". + :vartype service_tier: str or ~azure.ai.projects.models.LiveResponsesServiceTier + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.LiveDelegationReasoningInputParam + :ivar text: + :vartype text: ~azure.ai.projects.models.LiveDelegationTextInputParam + :ivar tools: Tools available to the Responses backend while it handles tasks delegated by the + Live model. + :vartype tools: list[~azure.ai.projects.models.LiveFunctionToolInputParam or + ~azure.ai.projects.models.LiveWebSearchToolInputParam or + ~azure.ai.projects.models.LiveFileSearchToolInputParam or + ~azure.ai.projects.models.LiveCodeInterpreterToolInputParam or + ~azure.ai.projects.models.LiveHostedShellToolInputParam or + ~azure.ai.projects.models.LiveImageGenerationToolInputParam or + ~azure.ai.projects.models.LiveMCPToolInputParam or + ~azure.ai.projects.models.LiveCustomToolInputParam or + ~azure.ai.projects.models.LiveNamespaceToolInputParam or + ~azure.ai.projects.models.LiveToolSearchToolInputParam or + ~azure.ai.projects.models.LiveProgrammaticToolInputParam or + ~azure.ai.projects.models.LiveComputerToolInputParam or + ~azure.ai.projects.models.LiveApplyPatchToolInputParam] + :ivar tool_choice: Controls which tool the Responses backend uses when handling a task + delegated by the Live model. Is one of the following types: Union[str, + "_models.LiveToolChoiceEnum"], LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, + LiveSpecificFileSearchParam, LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, + LiveSpecificImageGenParam, LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam + :vartype tool_choice: str or ~azure.ai.projects.models.LiveToolChoiceEnum or + ~azure.ai.projects.models.LiveFunctionToolChoiceParam or + ~azure.ai.projects.models.LiveMCPToolChoiceParam or + ~azure.ai.projects.models.LiveSpecificFileSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchParam or + ~azure.ai.projects.models.LiveSpecificWebSearchPreviewParam or + ~azure.ai.projects.models.LiveSpecificImageGenParam or + ~azure.ai.projects.models.LiveSpecificComputerParam or + ~azure.ai.projects.models.LiveSpecificCodeInterpreterParam or + ~azure.ai.projects.models.LiveSpecificProgrammaticToolCallingParam or + ~azure.ai.projects.models.LiveSpecificFunctionShellParam or + ~azure.ai.projects.models.LiveSpecificCustomToolParam or + ~azure.ai.projects.models.LiveSpecificApplyPatchParam or + ~azure.ai.projects.models.LiveAllowedToolsChoiceParam + :ivar parallel_tool_calls: + :vartype parallel_tool_calls: bool """ - delegation: Optional[Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationUpdateParam"]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Responses backend model to use for subsequent delegated requests. Omit to keep the current + backend model.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"auto\", \"default\", \"fast_tier_temp_pilot\", \"flex\", \"priority\", and + \"ultrafast\".""" + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + text: Optional["_models.LiveDelegationTextInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Is either a LiveClientDelegationParam type or a LiveResponsesDelegationUpdateParam type.""" + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tools available to the Responses backend while it handles tasks delegated by the Live model.""" + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Controls which tool the Responses backend uses when handling a task delegated by the Live + model. Is one of the following types: Union[str, \"_models.LiveToolChoiceEnum\"], + LiveFunctionToolChoiceParam, LiveMCPToolChoiceParam, LiveSpecificFileSearchParam, + LiveSpecificWebSearchParam, LiveSpecificWebSearchPreviewParam, LiveSpecificImageGenParam, + LiveSpecificComputerParam, LiveSpecificCodeInterpreterParam, + LiveSpecificProgrammaticToolCallingParam, LiveSpecificFunctionShellParam, + LiveSpecificCustomToolParam, LiveSpecificApplyPatchParam, LiveAllowedToolsChoiceParam""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - delegation: Optional[ - Union["_models.LiveClientDelegationParam", "_models.LiveResponsesDelegationUpdateParam"] + model: Optional[str] = None, + instructions: Optional[str] = None, + max_output_tokens: Optional[int] = None, + service_tier: Optional[Union[str, "_models.LiveResponsesServiceTier"]] = None, + reasoning: Optional["_models.LiveDelegationReasoningInputParam"] = None, + text: Optional["_models.LiveDelegationTextInputParam"] = None, + tools: Optional[ + list[ + Union[ + "_models.LiveFunctionToolInputParam", + "_models.LiveWebSearchToolInputParam", + "_models.LiveFileSearchToolInputParam", + "_models.LiveCodeInterpreterToolInputParam", + "_models.LiveHostedShellToolInputParam", + "_models.LiveImageGenerationToolInputParam", + "_models.LiveMCPToolInputParam", + "_models.LiveCustomToolInputParam", + "_models.LiveNamespaceToolInputParam", + "_models.LiveToolSearchToolInputParam", + "_models.LiveProgrammaticToolInputParam", + "_models.LiveComputerToolInputParam", + "_models.LiveApplyPatchToolInputParam", + ] + ] + ] = None, + tool_choice: Optional[ + Union[ + str, + "_models.LiveToolChoiceEnum", + "_models.LiveFunctionToolChoiceParam", + "_models.LiveMCPToolChoiceParam", + "_models.LiveSpecificFileSearchParam", + "_models.LiveSpecificWebSearchParam", + "_models.LiveSpecificWebSearchPreviewParam", + "_models.LiveSpecificImageGenParam", + "_models.LiveSpecificComputerParam", + "_models.LiveSpecificCodeInterpreterParam", + "_models.LiveSpecificProgrammaticToolCallingParam", + "_models.LiveSpecificFunctionShellParam", + "_models.LiveSpecificCustomToolParam", + "_models.LiveSpecificApplyPatchParam", + "_models.LiveAllowedToolsChoiceParam", + ] ] = None, + parallel_tool_calls: Optional[bool] = None, ) -> None: ... @overload @@ -16386,24 +16380,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LiveSessionUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cumulative audio duration for a Live session. Values are totals for the session, not increments - to sum across usage events. +class LiveResponsesDelegationUpdateParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Update the Responses backend for an existing Live session without changing delegation + ownership. - :ivar seconds: The cumulative Live audio duration in seconds. Do not sum this value across - usage events. Required. - :vartype seconds: float + :ivar type: The delegation owner. Always ``responses`` for tasks handled by the Responses API. + Required. Default value is "responses". + :vartype type: str + :ivar responses: Responses backend settings to update. Omitted settings keep their existing + values. + :vartype responses: ~azure.ai.projects.models.LiveResponsesDelegationSettingsUpdateInputParam """ - seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The cumulative Live audio duration in seconds. Do not sum this value across usage events. - Required.""" + type: Literal["responses"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The delegation owner. Always ``responses`` for tasks handled by the Responses API. Required. + Default value is \"responses\".""" + responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Responses backend settings to update. Omitted settings keep their existing values.""" @overload def __init__( self, *, - seconds: float, + responses: Optional["_models.LiveResponsesDelegationSettingsUpdateInputParam"] = None, ) -> None: ... @overload @@ -16415,35 +16416,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["responses"] = "responses" -class LiveTransportAnswered( - LiveServerEvent, discriminator="transport.answered" +class LiveServerEventLiveCommentaryAppended( + LiveServerEvent, discriminator="session.commentary.appended" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The outbound SIP provider leg answered and media is established. Delivered only to sideband - observers. + """Returned when a session.commentary.append command is accepted into the Live session timeline. + Acknowledges the added commentary without guaranteeing exact wording or completed audio + playback. - :ivar event_id: Required. + :ivar event_id: The unique ID of the Live server event. Required. :vartype event_id: str - :ivar session_id: The canonical Live session ID. Required. - :vartype session_id: str - :ivar type: Required. TRANSPORT_ANSWERED. - :vartype type: str or ~azure.ai.projects.models.TRANSPORT_ANSWERED + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.commentary.appended``. Required. + SESSION_COMMENTARY_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_COMMENTARY_APPENDED """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The canonical Live session ID. Required.""" - type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TRANSPORT_ANSWERED.""" + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_COMMENTARY_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.commentary.appended``. Required. SESSION_COMMENTARY_APPENDED.""" @overload def __init__( self, *, event_id: str, - session_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16455,38 +16474,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.TRANSPORT_ANSWERED # type: ignore + self.type = LiveServerEventType.SESSION_COMMENTARY_APPENDED # type: ignore -class LiveTransportCallError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LiveTransportCallError. +class LiveServerEventLiveDecisionEvent( + LiveServerEvent, discriminator="decision.event" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Decision API event for a Live delegation or transcript trigger. For a trigger, + source_event_id identifies the transcript delta that caused this evaluation. - :ivar type: Required. Default value is "call_error". - :vartype type: str - :ivar code: The call setup failure code. Required. - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: The parameter related to the error, if any. Empty when no parameter applies. - :vartype param: str + :ivar type: Required. DECISION_EVENT. + :vartype type: str or ~azure.ai.projects.models.DECISION_EVENT + :ivar event_id: The unique ID of this Live server event. Required. + :vartype event_id: str + :ivar delegation_id: Required. + :vartype delegation_id: str + :ivar trigger_id: Required. + :vartype trigger_id: str + :ivar source_event_type: Required. Is either a Literal["session.input_transcript.delta"] type + or a Literal["session.output_transcript.delta"] type. + :vartype source_event_type: str or str + :ivar source_event_id: Required. + :vartype source_event_id: str + :ivar event: Required. + :vartype event: ~azure.ai.projects.models.LiveDecisionCompleted """ - type: Literal["call_error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"call_error\".""" - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The call setup failure code. Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveServerEventType.DECISION_EVENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_EVENT.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this Live server event. Required.""" + delegation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + trigger_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + source_event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is either a Literal[\"session.input_transcript.delta\"] type or a + Literal[\"session.output_transcript.delta\"] type.""" + source_event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: "_models.LiveDecisionCompleted" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parameter related to the error, if any. Empty when no parameter applies.""" @overload def __init__( self, *, - code: str, - message: str, - param: Optional[str] = None, + event_id: str, + delegation_id: str, + trigger_id: str, + source_event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"], + source_event_id: str, + event: "_models.LiveDecisionCompleted", ) -> None: ... @overload @@ -16498,27 +16539,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["call_error"] = "call_error" + self.type = LiveServerEventType.DECISION_EVENT # type: ignore -class LiveTransportDTMFReceived( - LiveServerEvent, discriminator="transport.dtmf.received" +class LiveServerEventLiveDecisionItemCreated( + LiveServerEvent, discriminator="decision.item.created" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A SIP DTMF keypress received from the caller. Delivered only to sideband observers. + """An input item was appended for future decisions. - :ivar type: Required. TRANSPORT_DTMF_RECEIVED. - :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_RECEIVED - :ivar event_id: Required. + :ivar event_id: The unique ID of the Live server event. Required. :vartype event_id: str - :ivar event: Required. - :vartype event: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. DECISION_ITEM_CREATED. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_CREATED + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.LiveDecisionStoredInputItemParam """ - type: Literal[LiveServerEventType.TRANSPORT_DTMF_RECEIVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TRANSPORT_DTMF_RECEIVED.""" event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.DECISION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_CREATED.""" + item: "_models.LiveDecisionStoredInputItemParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Required.""" @overload @@ -16526,7 +16574,8 @@ def __init__( self, *, event_id: str, - event: str, + item: "_models.LiveDecisionStoredInputItemParam", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16538,28 +16587,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.TRANSPORT_DTMF_RECEIVED # type: ignore + self.type = LiveServerEventType.DECISION_ITEM_CREATED # type: ignore -class LiveTransportDTMFSend( - LiveServerEvent, discriminator="transport.dtmf.send" +class LiveServerEventLiveDecisionItemDeleted( + LiveServerEvent, discriminator="decision.item.deleted" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to sideband observers; - this is not a client command. + """An input item was removed from future decisions. - :ivar type: Required. TRANSPORT_DTMF_SEND. - :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_SEND - :ivar event_id: Required. + :ivar event_id: The unique ID of the Live server event. Required. :vartype event_id: str - :ivar event: Required. - :vartype event: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. DECISION_ITEM_DELETED. + :vartype type: str or ~azure.ai.projects.models.DECISION_ITEM_DELETED + :ivar item_id: Required. + :vartype item_id: str """ - type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TRANSPORT_DTMF_SEND.""" event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.DECISION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. DECISION_ITEM_DELETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload @@ -16567,7 +16620,8 @@ def __init__( self, *, event_id: str, - event: str, + item_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16579,40 +16633,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.TRANSPORT_DTMF_SEND # type: ignore + self.type = LiveServerEventType.DECISION_ITEM_DELETED # type: ignore -class LiveTransportFailed( - LiveServerEvent, discriminator="transport.failed" +class LiveServerEventLiveDelegationCreated( + LiveServerEvent, discriminator="session.delegation.created" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """An asynchronous outbound SIP setup failure. Delivered only to sideband observers. + """Returned when the Live model delegates work to your application, Responses, or Decisions. + Contains delegation metadata and the position on the session timeline where the work was + delegated. - :ivar event_id: Required. + :ivar event_id: The unique ID of the Live server event. Required. :vartype event_id: str - :ivar session_id: The canonical Live session ID. Required. - :vartype session_id: str - :ivar type: Required. TRANSPORT_FAILED. - :vartype type: str or ~azure.ai.projects.models.TRANSPORT_FAILED - :ivar error: Required. - :vartype error: ~azure.ai.projects.models.LiveTransportCallError + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.delegation.created``. Required. + SESSION_DELEGATION_CREATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_DELEGATION_CREATED + :ivar offset_ms: The position on the Live session timeline where the delegation was created, in + milliseconds from the beginning of the session. Required. + :vartype offset_ms: int + :ivar delegation: The delegated work identifier and destination. This object contains metadata, + not the task text. Required. + :vartype delegation: ~azure.ai.projects.models.VoiceAgentLiveDelegationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The canonical Live session ID. Required.""" - type: Literal[LiveServerEventType.TRANSPORT_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TRANSPORT_FAILED.""" - error: "_models.LiveTransportCallError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_DELEGATION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.delegation.created``. Required. SESSION_DELEGATION_CREATED.""" + offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The position on the Live session timeline where the delegation was created, in milliseconds + from the beginning of the session. Required.""" + delegation: "_models.VoiceAgentLiveDelegationItem" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The delegated work identifier and destination. This object contains metadata, not the task + text. Required.""" @overload def __init__( self, *, event_id: str, - session_id: str, - error: "_models.LiveTransportCallError", + offset_ms: int, + delegation: "_models.VoiceAgentLiveDelegationItem", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16624,36 +16693,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.TRANSPORT_FAILED # type: ignore + self.type = LiveServerEventType.SESSION_DELEGATION_CREATED # type: ignore -class LiveTransportRinging( - LiveServerEvent, discriminator="transport.ringing" +class LiveServerEventLiveErrorEvent( + LiveServerEvent, discriminator="error" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband - observers. + """Reports an error in the Live session, such as an invalid client command. Use + error.client_event_id, when present, to identify the command that caused the error. - :ivar event_id: Required. + :ivar event_id: The unique ID of the Live server event. Required. :vartype event_id: str - :ivar session_id: The canonical Live session ID. Required. - :vartype session_id: str - :ivar type: Required. TRANSPORT_RINGING. - :vartype type: str or ~azure.ai.projects.models.TRANSPORT_RINGING + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``error``. Required. ERROR. + :vartype type: str or ~azure.ai.projects.models.ERROR + :ivar error: Details of the Live error and the client command that caused it, when known. + Required. + :vartype error: ~azure.ai.projects.models.LiveLiveError """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The canonical Live session ID. Required.""" - type: Literal[LiveServerEventType.TRANSPORT_RINGING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TRANSPORT_RINGING.""" + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``error``. Required. ERROR.""" + error: "_models.LiveLiveError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of the Live error and the client command that caused it, when known. Required.""" @overload def __init__( self, *, event_id: str, - session_id: str, + error: "_models.LiveLiveError", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16665,59 +16741,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LiveServerEventType.TRANSPORT_RINGING # type: ignore - - -class LiveWebSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param - """A web search tool available to the Live session’s Responses backend. - - :ivar type: The tool type. Always ``web_search``. Required. Default value is "web_search". - :vartype type: str - """ - - type: Literal["web_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The tool type. Always ``web_search``. Required. Default value is \"web_search\".""" - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["web_search"] = "web_search" + self.type = LiveServerEventType.ERROR # type: ignore -class LocalShellToolParam( - Tool, discriminator="local_shell" +class LiveServerEventLiveInfoEvent( + LiveServerEvent, discriminator="info" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Local shell tool. + """An informational notice about the Live session, such as the event permissions applied to a + frontend data channel. - :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``info``. Required. INFO. + :vartype type: str or ~azure.ai.projects.models.INFO + :ivar code: A machine-readable code for the notice, such as ``data_channel_permissions``. + Required. + :vartype code: str + :ivar message: A human-readable explanation of the Live session notice. Required. + :vartype message: str """ - type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.INFO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``info``. Required. INFO.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A machine-readable code for the notice, such as ``data_channel_permissions``. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable explanation of the Live session notice. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + event_id: str, + code: str, + message: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16729,34 +16794,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.LOCAL_SHELL # type: ignore + self.type = LiveServerEventType.INFO # type: ignore -class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """LocalSkillParam. +class LiveServerEventLiveInputAudioMuted( + LiveServerEvent, discriminator="session.input_audio.muted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Acknowledges a session.input_audio.mute command. An independent input mute sends silence to the + model and preserves sideband audio reflection. Fixture playback does not emit this event. - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar description: The description of the skill. Required. - :vartype description: str - :ivar path: The path to the directory containing the skill. Required. - :vartype path: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.input_audio.muted``. Required. + SESSION_INPUT_AUDIO_MUTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_MUTED """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the skill. Required.""" - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path to the directory containing the skill. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_MUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.muted``. Required. SESSION_INPUT_AUDIO_MUTED.""" @overload def __init__( self, *, - name: str, - description: str, - path: str, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16768,33 +16837,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_MUTED # type: ignore -class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A log probability object. +class LiveServerEventLiveInputAudioUnmuted( + LiveServerEvent, discriminator="session.input_audio.unmuted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Acknowledges a session.input_audio.unmute command, removing the independent input mute. An + active audio fixture still pauses inference until playback finishes. Fixture playback does not + emit this event. - :ivar token: The token that was used to generate the log probability. Required. - :vartype token: str - :ivar logprob: The log probability of the token. Required. - :vartype logprob: float - :ivar bytes: The bytes that were used to generate the log probability. Required. - :vartype bytes: list[int] + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.input_audio.unmuted``. Required. + SESSION_INPUT_AUDIO_UNMUTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_AUDIO_UNMUTED """ - token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The token that was used to generate the log probability. Required.""" - logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The log probability of the token. Required.""" - bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The bytes that were used to generate the log probability. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_audio.unmuted``. Required. SESSION_INPUT_AUDIO_UNMUTED.""" @overload def __init__( self, *, - token: str, - logprob: float, - bytes: list[int], + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16806,43 +16881,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_AUDIO_UNMUTED # type: ignore -class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment - time. - - :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. - :vartype rank: int - :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. - :vartype alpha: int - :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). - Auto-detected from adapter_config.json if omitted. - :vartype target_modules: list[str] - :ivar dropout: Dropout rate used during training. Informational — not used at serving time. - :vartype dropout: float - """ +class LiveServerEventLiveInputTranscriptDelta( + LiveServerEvent, discriminator="session.input_transcript.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcript fragment for user input audio in the Live session. Accumulate fragments in + delivery order; these events do not define complete turns or include a transcript-done event. - rank: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" - alpha: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" - target_modules: Optional[list[str]] = rest_field( - name="targetModules", visibility=["read", "create", "update", "delete", "query"] - ) - """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from - adapter_config.json if omitted.""" - dropout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dropout rate used during training. Informational — not used at serving time.""" + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in + delivery order to build the transcript. Required. + :vartype delta: str + :ivar type: The event type, always ``session.input_transcript.delta``. Required. + SESSION_INPUT_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_INPUT_TRANSCRIPT_DELTA + """ + + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript text fragment for the audio in this time range. Append fragments in delivery + order to build the transcript. Required.""" + type: Literal[LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.input_transcript.delta``. Required. + SESSION_INPUT_TRANSCRIPT_DELTA.""" @overload def __init__( self, *, - rank: Optional[int] = None, - alpha: Optional[int] = None, - target_modules: Optional[list[str]] = None, - dropout: Optional[float] = None, + event_id: str, + start_ms: int, + end_ms: int, + delta: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16854,29 +16946,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_INPUT_TRANSCRIPT_DELTA # type: ignore -class ManagedAgentIdentityBlueprintReference( - AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" +class LiveServerEventLiveInstructionsAppended( + LiveServerEvent, discriminator="session.instructions.appended" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """ManagedAgentIdentityBlueprintReference. + """Returned when a session.instructions.append command is accepted into the Live session timeline. + Acknowledges the appended instructions without guaranteeing that the model has acted on them. - :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. - :vartype type: str or ~azure.ai.projects.models.MANAGED_AGENT_IDENTITY_BLUEPRINT - :ivar blueprint_id: The ID of the managed blueprint. Required. - :vartype blueprint_id: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.instructions.appended``. Required. + SESSION_INSTRUCTIONS_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_INSTRUCTIONS_APPENDED """ - type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" - blueprint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the managed blueprint. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.instructions.appended``. Required. + SESSION_INSTRUCTIONS_APPENDED.""" @overload def __init__( self, *, - blueprint_id: str, + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16888,42 +17004,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore + self.type = LiveServerEventType.SESSION_INSTRUCTIONS_APPENDED # type: ignore -class ManagedAzureAISearchIndex( - Index, discriminator="ManagedAzureSearch" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed Azure AI Search Index Definition. +class LiveServerEventLiveOutputAudioFixturePlayed( + LiveServerEvent, discriminator="session.output_audio.fixture.played" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The complete audio fixture has drained from the server mixer and normal inference has resumed. + Transport buffers may still contain audio; this event does not prove listener-side completion. + The optional client_event_id echoes the play command. This event is not emitted for canceled or + failed playback. - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar type: Type of index. Required. Managed Azure Search. - :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH - :ivar vector_store_id: Vector store id of managed index. Required. - :vartype vector_store_id: str + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED """ - type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Managed Azure Search.""" - vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) - """Vector store id of managed index. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED.""" @overload def __init__( self, *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16935,41 +17048,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYED # type: ignore -class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP list tools tool. +class LiveServerEventLiveOutputAudioFixturePlaying( + LiveServerEvent, discriminator="session.output_audio.fixture.playing" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The existing playback path has accepted the validated audio fixture. This acknowledgment does + not identify when the listener receives the first sample. The optional client_event_id echoes + the play command. - :ivar name: The name of the tool. Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar input_schema: The JSON schema describing the tool's input. Required. - :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema - :ivar annotations: - :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The JSON schema describing the tool's input. Required.""" - annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING.""" @overload def __init__( self, *, - name: str, - input_schema: "_models.MCPListToolsToolInputSchema", - description: Optional[str] = None, - annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, + event_id: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -16981,178 +17091,187 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_AUDIO_FIXTURE_PLAYING # type: ignore -class MCPListToolsToolAnnotations(_Model): - """MCPListToolsToolAnnotations.""" +class LiveServerEventLiveOutputTranscriptDelta( + LiveServerEvent, discriminator="session.output_transcript.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transcript fragment for assistant output audio in the Live session. Accumulate fragments in + delivery order; these events do not define complete turns or include a transcript-done event. + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar delta: The transcript text fragment for the audio in this time range. Append fragments in + delivery order to build the transcript. Required. + :vartype delta: str + :ivar type: The event type, always ``session.output_transcript.delta``. Required. + SESSION_OUTPUT_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.SESSION_OUTPUT_TRANSCRIPT_DELTA + """ -class MCPListToolsToolInputSchema(_Model): - """MCPListToolsToolInputSchema.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript text fragment for the audio in this time range. Append fragments in delivery + order to build the transcript. Required.""" + type: Literal[LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.output_transcript.delta``. Required. + SESSION_OUTPUT_TRANSCRIPT_DELTA.""" + @overload + def __init__( + self, + *, + event_id: str, + start_ms: int, + end_ms: int, + delta: str, + client_event_id: Optional[str] = None, + ) -> None: ... -class McpProtocolConfiguration(_Model): - """Configuration specific to the MCP protocol.""" + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_OUTPUT_TRANSCRIPT_DELTA # type: ignore -class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. - :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or - ``tunnel_id`` must be provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported - ``connector_id`` values are: +class LiveServerEventLiveResponseEvent( + LiveServerEvent, discriminator="response.event" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A streaming Responses API event from a backend delegated to by the Live session. Use the outer + delegation_id to associate the nested stream with its Live delegation. - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], - Literal["connector_googledrive"], Literal["connector_microsoftteams"], - Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], - Literal["connector_sharepoint"] + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``response.event``. Required. RESPONSE_EVENT. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_EVENT + :ivar delegation_id: + :vartype delegation_id: str + :ivar event: The nested Responses streaming event. Dispatch on its type field. Response + lifecycle snapshots omit input and clear instructions, tools, and output to keep messages + small; consume granular output events for the generated content. Required. + :vartype event: dict[str, any] + """ - :vartype connector_id: str or str or str or str or str or str or str or str - :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. - :vartype tunnel_id: str - :ivar authorization: An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application must handle the OAuth - authorization flow and provide the token here. - :vartype authorization: str - :ivar server_description: Optional description of the MCP server, used to provide more context. - :vartype server_description: str - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. - :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str - :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. - :vartype defer_loading: bool - :ivar project_connection_id: The connection ID in the project for the MCP server. The - connection stores authentication and other connection details needed to connect to the MCP - server. - :vartype project_connection_id: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.RESPONSE_EVENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``response.event``. Required. RESPONSE_EVENT.""" + delegation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The nested Responses streaming event. Dispatch on its type field. Response lifecycle snapshots + omit input and clear instructions, tools, and output to keep messages small; consume granular + output events for the generated content. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + event: dict[str, Any], + client_event_id: Optional[str] = None, + delegation_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = LiveServerEventType.RESPONSE_EVENT # type: ignore + + +class LiveServerEventLiveSessionClosed( + LiveServerEvent, discriminator="session.closed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned after the Live session finishes finalizing, with the close reason, final session + snapshot, and cumulative audio usage. A connection closing without this event does not confirm + successful finalization. + + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.closed``. Required. SESSION_CLOSED. + :vartype type: str or ~azure.ai.projects.models.SESSION_CLOSED + :ivar reason: Why the Live session ended: ``close_requested`` for an application close or + hangup request, ``expired`` for the session duration limit, ``content`` for a safety filter, + ``remote_hangup`` for a graceful remote disconnect, or ``connection_lost`` for an unexpected + primary or upstream disconnection. Required. Is one of the following types: + Literal["close_requested"], Literal["expired"], Literal["content"], Literal["remote_hangup"], + Literal["connection_lost"] + :vartype reason: str or str or str or str or str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource + :ivar usage: The final cumulative Live audio usage after session finalization. Required. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage """ - type: Literal[ToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the MCP tool. Always ``mcp``. Required. MCP.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported - ``connector_id`` values are: - - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], - Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], - Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], - Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" - tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided.""" - authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An OAuth access token that can be used with a remote MCP server, either with a custom MCP - server URL or a service connector. Your application must handle the OAuth authorization flow - and provide the token here.""" - server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_CLOSED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.closed``. Required. SESSION_CLOSED.""" + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The connection ID in the project for the MCP server. The connection stores authentication and - other connection details needed to connect to the MCP server.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + """Why the Live session ended: ``close_requested`` for an application close or hangup request, + ``expired`` for the session duration limit, ``content`` for a safety filter, ``remote_hangup`` + for a graceful remote disconnect, or ``connection_lost`` for an unexpected primary or upstream + disconnection. Required. Is one of the following types: Literal[\"close_requested\"], + Literal[\"expired\"], Literal[\"content\"], Literal[\"remote_hangup\"], + Literal[\"connection_lost\"]""" + session: "_models.VoiceAgentLiveSessionResource" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Deprecated. This property is deprecated and will be removed in a future version.""" + """Required.""" + usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final cumulative Live audio usage after session finalization. Required.""" @overload def __init__( self, *, - server_label: str, - server_url: Optional[str] = None, - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = None, - tunnel_id: Optional[str] = None, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, - defer_loading: Optional[bool] = None, - project_connection_id: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + event_id: str, + reason: Literal["close_requested", "expired", "content", "remote_hangup", "connection_lost"], + session: "_models.VoiceAgentLiveSessionResource", + usage: "_models.LiveSessionUsage", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17164,170 +17283,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MCP # type: ignore - + self.type = LiveServerEventType.SESSION_CLOSED # type: ignore -class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only - """An MCP tool stored in a toolbox. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or - ``tunnel_id`` must be provided. - :vartype server_url: str - :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported - ``connector_id`` values are: +class LiveServerEventLiveSessionStarted( + LiveServerEvent, discriminator="session.started" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Live session has started. Contains the resolved session configuration, + including server defaults. - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], - Literal["connector_googledrive"], Literal["connector_microsoftteams"], - Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], - Literal["connector_sharepoint"] - - :vartype connector_id: str or str or str or str or str or str or str or str - :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of - ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. - :vartype tunnel_id: str - :ivar authorization: An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application must handle the OAuth - authorization flow and provide the token here. - :vartype authorization: str - :ivar server_description: Optional description of the MCP server, used to provide more context. - :vartype server_description: str - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. - :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar require_approval: Is one of the following types: MCPToolRequireApproval, - Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str - :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. - :vartype defer_loading: bool - :ivar project_connection_id: The connection ID in the project for the MCP server. The - connection stores authentication and other connection details needed to connect to the MCP - server. - :vartype project_connection_id: str + :ivar type: The event type, always ``session.started``. Required. SESSION_STARTED. + :vartype type: str or ~azure.ai.projects.models.SESSION_STARTED + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource + :ivar conversation_id: Stored conversation ID when effective store is true. Use + protocols/voice/live/conversations; this ID differs from session.id. + :vartype conversation_id: str """ - type: Literal[ToolboxToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MCP.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be - provided.""" - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported - ``connector_id`` values are: - - * Dropbox: `connector_dropbox` - * Gmail: `connector_gmail` - * Google Calendar: `connector_googlecalendar` - * Google Drive: `connector_googledrive` - * Microsoft Teams: `connector_microsoftteams` - * Outlook Calendar: `connector_outlookcalendar` - * Outlook Email: `connector_outlookemail` - * SharePoint: `connector_sharepoint`. Is one of the following types: - Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], - Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], - Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], - Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" - tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, - ``connector_id``, or ``tunnel_id`` must be provided.""" - authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An OAuth access token that can be used with a remote MCP server, either with a custom MCP - server URL or a service connector. Your application must handle the OAuth authorization flow - and provide the token here.""" - server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of the MCP server, used to provide more context.""" - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a [str] type or a MCPToolFilter type.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + type: Literal[LiveServerEventType.SESSION_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.started``. Required. SESSION_STARTED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + session: "_models.VoiceAgentLiveSessionResource" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" - defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this MCP tool is deferred and discovered via tool search.""" - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The connection ID in the project for the MCP server. The connection stores authentication and - other connection details needed to connect to the MCP server.""" + """Required.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Stored conversation ID when effective store is true. Use protocols/voice/live/conversations; + this ID differs from session.id.""" @overload def __init__( self, *, - server_label: str, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - server_url: Optional[str] = None, - connector_id: Optional[ - Literal[ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint", - ] - ] = None, - tunnel_id: Optional[str] = None, - authorization: Optional[str] = None, - server_description: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, - require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, - defer_loading: Optional[bool] = None, - project_connection_id: Optional[str] = None, + event_id: str, + session: "_models.VoiceAgentLiveSessionResource", + client_event_id: Optional[str] = None, + conversation_id: Optional[str] = None, ) -> None: ... @overload @@ -17339,35 +17339,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.MCP # type: ignore + self.type = LiveServerEventType.SESSION_STARTED # type: ignore -class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool filter. +class LiveServerEventLiveSessionUpdated( + LiveServerEvent, discriminator="session.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Live session update is accepted. Contains the resolved session configuration + after the update. - :ivar tool_names: MCP allowed tools. - :vartype tool_names: list[str] - :ivar read_only: Indicates whether or not a tool modifies data or is read-only. If an MCP - server is `annotated with `readOnlyHint` - `_, - it will match this filter. - :vartype read_only: bool + :ivar type: The event type, always ``session.updated``. Required. SESSION_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar session: Required. + :vartype session: ~azure.ai.projects.models.VoiceAgentLiveSessionResource """ - tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """MCP allowed tools.""" - read_only: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates whether or not a tool modifies data or is read-only. If an MCP server is `annotated - with `readOnlyHint` - `_, - it will match this filter.""" + type: Literal[LiveServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.updated``. Required. SESSION_UPDATED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + session: "_models.VoiceAgentLiveSessionResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" @overload def __init__( self, *, - tool_names: Optional[list[str]] = None, - read_only: Optional[bool] = None, + event_id: str, + session: "_models.VoiceAgentLiveSessionResource", + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17379,26 +17388,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_UPDATED # type: ignore -class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCPToolRequireApproval. +class LiveServerEventLiveSessionUsageUpdated( + LiveServerEvent, discriminator="session.usage.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reports cumulative Live audio usage and, when available, the most recent context-window usage. + Delegated Responses token usage is reported separately in response.event events. - :ivar always: - :vartype always: ~azure.ai.projects.models.MCPToolFilter - :ivar never: - :vartype never: ~azure.ai.projects.models.MCPToolFilter + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar type: The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_USAGE_UPDATED + :ivar usage: The cumulative Live audio usage so far. Required. + :vartype usage: ~azure.ai.projects.models.LiveSessionUsage + :ivar context_window: The latest measured Live context-window usage. Omitted when the context + limit is unknown. + :vartype context_window: ~azure.ai.projects.models.LiveContextWindowUsage """ - always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + type: Literal[LiveServerEventType.SESSION_USAGE_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.usage.updated``. Required. SESSION_USAGE_UPDATED.""" + usage: "_models.LiveSessionUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cumulative Live audio usage so far. Required.""" + context_window: Optional["_models.LiveContextWindowUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The latest measured Live context-window usage. Omitted when the context limit is unknown.""" @overload def __init__( self, *, - always: Optional["_models.MCPToolFilter"] = None, - never: Optional["_models.MCPToolFilter"] = None, + event_id: str, + usage: "_models.LiveSessionUsage", + client_event_id: Optional[str] = None, + context_window: Optional["_models.LiveContextWindowUsage"] = None, ) -> None: ... @overload @@ -17410,32 +17443,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_USAGE_UPDATED # type: ignore -class MemoryOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a single memory operation (create, update, or delete) performed on a memory item. +class LiveServerEventLiveThinkingAppended( + LiveServerEvent, discriminator="session.thinking.appended" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a session.thinking.append command is accepted into the Live session timeline. + Acknowledges the added reasoning context without guaranteeing any spoken output. - :ivar kind: The type of memory operation being performed. Required. Known values are: "create", - "update", and "delete". - :vartype kind: str or ~azure.ai.projects.models.MemoryOperationKind - :ivar memory_item: The memory item to create, update, or delete. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :ivar event_id: The unique ID of the Live server event. Required. + :vartype event_id: str + :ivar client_event_id: The event_id of the client command associated with this server event, + when supplied. + :vartype client_event_id: str + :ivar start_ms: The start of this event on the Live session timeline, in milliseconds from the + beginning of the session. Required. + :vartype start_ms: int + :ivar end_ms: The end of this event on the Live session timeline, in milliseconds from the + beginning of the session. For appended context, this can equal start_ms. Required. + :vartype end_ms: int + :ivar type: The event type, always ``session.thinking.appended``. Required. + SESSION_THINKING_APPENDED. + :vartype type: str or ~azure.ai.projects.models.SESSION_THINKING_APPENDED """ - kind: Union[str, "_models.MemoryOperationKind"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of memory operation being performed. Required. Known values are: \"create\", - \"update\", and \"delete\".""" - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory item to create, update, or delete. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the Live server event. Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command associated with this server event, when supplied.""" + start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start of this event on the Live session timeline, in milliseconds from the beginning of the + session. Required.""" + end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end of this event on the Live session timeline, in milliseconds from the beginning of the + session. For appended context, this can equal start_ms. Required.""" + type: Literal[LiveServerEventType.SESSION_THINKING_APPENDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, always ``session.thinking.appended``. Required. SESSION_THINKING_APPENDED.""" @overload def __init__( self, *, - kind: Union[str, "_models.MemoryOperationKind"], - memory_item: "_models.MemoryItem", + event_id: str, + start_ms: int, + end_ms: int, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -17447,23 +17500,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.SESSION_THINKING_APPENDED # type: ignore -class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A retrieved memory item from memory search. +class LiveServerEventLiveTransportAnswered( + LiveServerEvent, discriminator="transport.answered" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The outbound SIP provider leg answered and media is established. Delivered only to sideband + observers. - :ivar memory_item: Retrieved memory item. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_ANSWERED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_ANSWERED """ - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Retrieved memory item. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_ANSWERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_ANSWERED.""" @overload def __init__( self, *, - memory_item: "_models.MemoryItem", + event_id: str, + session_id: str, ) -> None: ... @overload @@ -17475,23 +17541,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_ANSWERED # type: ignore -class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory search options. +class LiveServerEventLiveTransportFailed( + LiveServerEvent, discriminator="transport.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An asynchronous outbound SIP setup failure. Delivered only to sideband observers. - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_FAILED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_FAILED + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.LiveTransportCallError """ - max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of memory items to return.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_FAILED.""" + error: "_models.LiveTransportCallError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - max_memories: Optional[int] = None, + event_id: str, + session_id: str, + error: "_models.LiveTransportCallError", ) -> None: ... @overload @@ -17503,52 +17586,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_FAILED # type: ignore -class MemorySearchPreviewTool( - Tool, discriminator="memory_search_preview" +class LiveServerEventLiveTransportRinging( + LiveServerEvent, discriminator="transport.ringing" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A tool for integrating memories into the agent. + """The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband + observers. - :ivar type: The type of the tool. Always ``memory_search_preview``. Required. - MEMORY_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_PREVIEW - :ivar memory_store_name: The name of the memory store to use. Required. - :vartype memory_store_name: str - :ivar scope: The namespace used to group and isolate memories, such as a user ID. Limits which - memories can be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to - the current signed-in user. Required. - :vartype scope: str - :ivar search_options: Options for searching the memory store. - :vartype search_options: ~azure.ai.projects.models.MemorySearchOptions - :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default - 300. - :vartype update_delay: int + :ivar event_id: Required. + :vartype event_id: str + :ivar session_id: The canonical Live session ID. Required. + :vartype session_id: str + :ivar type: Required. TRANSPORT_RINGING. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_RINGING """ - type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" - memory_store_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store to use. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace used to group and isolate memories, such as a user ID. Limits which memories can - be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to the current - signed-in user. Required.""" - search_options: Optional["_models.MemorySearchOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Options for searching the memory store.""" - update_delay: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Time to wait before updating memories after inactivity (seconds). Default 300.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + session_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The canonical Live session ID. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_RINGING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_RINGING.""" @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional["_models.MemorySearchOptions"] = None, - update_delay: Optional[int] = None, + event_id: str, + session_id: str, ) -> None: ... @overload @@ -17560,28 +17627,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore - + self.type = LiveServerEventType.TRANSPORT_RINGING # type: ignore -class MemoryStoreDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base definition for memory store configurations. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - MemoryStoreDefaultDefinition +class LiveSessionAudioFormatPCMAParam( + LiveAudioFormat, discriminator="audio/pcma" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono G.711 A-law audio for a Live WebSocket connection. - :ivar kind: The kind of the memory store. Required. "default" - :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + :ivar type: The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. + :vartype rate: int """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory store. Required. \"default\"""" + type: Literal[LiveAudioFormatType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcma``. Required. AUDIO_PCMA.""" + rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" @overload def __init__( self, *, - kind: str, + rate: int, ) -> None: ... @overload @@ -17593,42 +17662,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveAudioFormatType.AUDIO_PCMA # type: ignore -class MemoryStoreDefaultDefinition( - MemoryStoreDefinition, discriminator="default" +class LiveSessionAudioFormatPCMParam( + LiveAudioFormat, discriminator="audio/pcm" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default memory store implementation. + """Raw, mono 16-bit little-endian PCM audio for a Live WebSocket connection. - :ivar kind: The kind of the memory store. Required. The default memory store implementation. - :vartype kind: str or ~azure.ai.projects.models.DEFAULT - :ivar chat_model: The name or identifier of the chat completion model deployment used for - memory processing. Required. - :vartype chat_model: str - :ivar embedding_model: The name or identifier of the embedding model deployment used for memory - processing. Required. - :vartype embedding_model: str - :ivar options: Default memory store options. - :vartype options: ~azure.ai.projects.models.MemoryStoreDefaultOptions + :ivar type: The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. + Required. Is either a Literal[16000] type or a Literal[24000] type. + :vartype rate: int or int """ - kind: Literal[MemoryStoreKind.DEFAULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory store. Required. The default memory store implementation.""" - chat_model: str = rest_field(visibility=["read", "create"]) - """The name or identifier of the chat completion model deployment used for memory processing. - Required.""" - embedding_model: str = rest_field(visibility=["read", "create"]) - """The name or identifier of the embedding model deployment used for memory processing. Required.""" - options: Optional["_models.MemoryStoreDefaultOptions"] = rest_field(visibility=["read", "create"]) - """Default memory store options.""" + type: Literal[LiveAudioFormatType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcm``. Required. AUDIO_PCM.""" + rate: Literal[16000, 24000] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. Live WebSocket PCM audio supports 16000 or 24000 Hz. Required. Is + either a Literal[16000] type or a Literal[24000] type.""" @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional["_models.MemoryStoreDefaultOptions"] = None, + rate: Literal[16000, 24000], ) -> None: ... @overload @@ -17640,53 +17699,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryStoreKind.DEFAULT # type: ignore + self.type = LiveAudioFormatType.AUDIO_PCM # type: ignore -class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default memory store configurations. +class LiveSessionAudioFormatPCMUParam( + LiveAudioFormat, discriminator="audio/pcmu" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Raw, mono G.711 μ-law audio for a Live WebSocket connection. - :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is - true. Required. - :vartype user_profile_enabled: bool - :ivar user_profile_details: Specific categories or types of user profile information to extract - and store. - :vartype user_profile_details: str - :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Defaults to - ``true``. Required. - :vartype chat_summary_enabled: bool - :ivar procedural_memory_enabled: Whether to enable procedural memory extraction and storage. - The service defaults to ``true`` if a value is not specified by the caller. - :vartype procedural_memory_enabled: bool - :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of ``0`` - indicates that memories do not expire. Defaults to ``0``. - :vartype default_ttl_seconds: ~datetime.timedelta + :ivar type: The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + :ivar rate: Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required. + :vartype rate: int """ - user_profile_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable user profile extraction and storage. Default is true. Required.""" - user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specific categories or types of user profile information to extract and store.""" - chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" - procedural_memory_enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable procedural memory extraction and storage. The service defaults to ``true`` if - a value is not specified by the caller.""" - default_ttl_seconds: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do - not expire. Defaults to ``0``.""" - - @overload - def __init__( + type: Literal[LiveAudioFormatType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The audio encoding. Always ``audio/pcmu``. Required. AUDIO_PCMU.""" + rate: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Audio sample rate in hertz. G.711 audio uses 8000 Hz. Required.""" + + @overload + def __init__( self, *, - user_profile_enabled: bool, - chat_summary_enabled: bool, - user_profile_details: Optional[str] = None, - procedural_memory_enabled: Optional[bool] = None, - default_ttl_seconds: Optional[datetime.timedelta] = None, + rate: int, ) -> None: ... @overload @@ -17698,41 +17734,97 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveAudioFormatType.AUDIO_PCMU # type: ignore -class MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response for deleting memories from a scope. +class LiveSessionCreateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Initial configuration for a Live session, including its model, conversation instructions, + audio, and delegated task handling. - :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. - MEMORY_STORE_SCOPE_DELETED. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_SCOPE_DELETED - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar scope: The scope from which memories were deleted. Required. - :vartype scope: str - :ivar deleted: Whether the deletion operation was successful. Required. - :vartype deleted: bool + :ivar model: Required. "gpt-live-1" + :vartype model: str or ~azure.ai.projects.models.ModelIdsLive + :ivar instructions: + :vartype instructions: str + :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and + assistant messages with one text part each; at most 128 messages and a configured + rendered-token limit (8,192 by default). + :vartype input: list[~azure.ai.projects.models.LiveInitialItem] + :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC + and SIP negotiate their media format. Voice and format are immutable after startup. + :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar delegation: Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationParam, LiveDecisionsDelegationParam_2 + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationParam or + ~azure.ai.projects.models.LiveDecisionsDelegationParam_2 + :ivar triggers: At most one Decisions trigger per transcript event type. Triggers run + independently of delegation. On update, omit triggers to keep the current configuration, send a + list to replace it, or send an empty list to disable triggers. + :vartype triggers: list[~azure.ai.projects.models.LiveDecisionTriggerInputParam_2] + :ivar store: Whether to store the session for later forking and recording download. Defaults to + false for new sessions. + :vartype store: bool + :ivar client: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC + session. Trusted sideband connections are unaffected. + :vartype client: ~azure.ai.projects.models.LiveClientConfigParam """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] = rest_field( + model: Union[str, "_models.ModelIdsLive"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. \"gpt-live-1\"""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input: Optional[list["_models.LiveInitialItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The object type. Always 'memory_store.scope.deleted'. Required. MEMORY_STORE_SCOPE_DELETED.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The scope from which memories were deleted. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the deletion operation was successful. Required.""" + """Ordered text-only history supplied before startup. Supports developer, user, and assistant + messages with one text part each; at most 128 messages and a configured rendered-token limit + (8,192 by default).""" + audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP + negotiate their media format. Voice and format are immutable after startup.""" + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationParam", + "_models.LiveDecisionsDelegationParam_2", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: LiveClientDelegationParam, LiveResponsesDelegationParam, + LiveDecisionsDelegationParam_2""" + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """At most one Decisions trigger per transcript event type. Triggers run independently of + delegation. On update, omit triggers to keep the current configuration, send a list to replace + it, or send an empty list to disable triggers.""" + store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to store the session for later forking and recording download. Defaults to false for + new sessions.""" + client: Optional["_models.LiveClientConfigParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. + Trusted sideband connections are unaffected.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], - name: str, - scope: str, - deleted: bool, + model: Union[str, "_models.ModelIdsLive"], + instructions: Optional[str] = None, + input: Optional[list["_models.LiveInitialItem"]] = None, + audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationParam", + "_models.LiveDecisionsDelegationParam_2", + ] + ] = None, + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = None, + store: Optional[bool] = None, + client: Optional["_models.LiveClientConfigParam"] = None, ) -> None: ... @overload @@ -17746,63 +17838,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory store that can store and retrieve user memories. +class LiveSessionStartEvent( + LiveClientEvent, discriminator="session.start" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Start a Live session on a primary WebSocket. Send this event before other commands and wait for + ``session.started``. - :ivar object: The object type, which is always 'memory_store'. Required. MEMORY_STORE. - :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE - :ivar id: The unique identifier of the memory store. Required. - :vartype id: str - :ivar created_at: The Unix timestamp (seconds) when the memory store was created. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The Unix timestamp (seconds) when the memory store was last updated. - Required. - :vartype updated_at: ~datetime.datetime - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar description: A human-readable description of the memory store. - :vartype description: str - :ivar metadata: Arbitrary key-value metadata to associate with the memory store. - :vartype metadata: dict[str, str] - :ivar definition: The definition of the memory store. Required. - :vartype definition: ~azure.ai.projects.models.MemoryStoreDefinition + :ivar event_id: + :vartype event_id: str + :ivar type: The Live client event type. Always ``session.start``. Required. SESSION_START. + :vartype type: str or ~azure.ai.projects.models.SESSION_START + :ivar session: Initial configuration for a primary WebSocket. Send session.start first and wait + for session.started before application commands. WebRTC creation already starts the session; do + not send this event again on its data channel. Required. + :vartype session: ~azure.ai.projects.models.LiveSessionCreateParams """ - object: Literal[MemoryStoreObjectType.MEMORY_STORE] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, which is always 'memory_store'. Required. MEMORY_STORE.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the memory store. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the memory store was created. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the memory store was last updated. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the memory store.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Arbitrary key-value metadata to associate with the memory store.""" - definition: "_models.MemoryStoreDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The definition of the memory store. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[LiveClientEventType.SESSION_START] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Live client event type. Always ``session.start``. Required. SESSION_START.""" + session: "_models.LiveSessionCreateParams" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Initial configuration for a primary WebSocket. Send session.start first and wait for + session.started before application commands. WebRTC creation already starts the session; do not + send this event again on its data channel. Required.""" @overload def __init__( self, *, - object: Literal[MemoryStoreObjectType.MEMORY_STORE], - id: str, # pylint: disable=redefined-builtin - created_at: datetime.datetime, - updated_at: datetime.datetime, - name: str, - definition: "_models.MemoryStoreDefinition", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, + session: "_models.LiveSessionCreateParams", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -17814,52 +17879,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveClientEventType.SESSION_START # type: ignore -class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Usage statistics of a memory store operation. +class LiveSessionUpdateParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Changes to an active Live session's delegation settings and transcript triggers. - :ivar embedding_tokens: The number of embedding tokens. Required. - :vartype embedding_tokens: int - :ivar input_tokens: The number of input tokens. Required. - :vartype input_tokens: int - :ivar input_tokens_details: A detailed breakdown of the input tokens. Required. - :vartype input_tokens_details: ~azure.ai.projects.models.ResponseUsageInputTokensDetails - :ivar output_tokens: The number of output tokens. Required. - :vartype output_tokens: int - :ivar output_tokens_details: A detailed breakdown of the output tokens. Required. - :vartype output_tokens_details: ~azure.ai.projects.models.ResponseUsageOutputTokensDetails - :ivar total_tokens: The total number of tokens used. Required. - :vartype total_tokens: int + :ivar delegation: Is one of the following types: LiveClientDelegationParam, + LiveResponsesDelegationUpdateParam, LiveDecisionsDelegationUpdateParam + :vartype delegation: ~azure.ai.projects.models.LiveClientDelegationParam or + ~azure.ai.projects.models.LiveResponsesDelegationUpdateParam or + ~azure.ai.projects.models.LiveDecisionsDelegationUpdateParam + :ivar triggers: At most one Decisions trigger per transcript event type. Triggers run + independently of delegation. On update, omit triggers to keep the current configuration, send a + list to replace it, or send an empty list to disable triggers. + :vartype triggers: list[~azure.ai.projects.models.LiveDecisionTriggerInputParam_2] """ - embedding_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of embedding tokens. Required.""" - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of input tokens. Required.""" - input_tokens_details: "_models.ResponseUsageInputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the input tokens. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of output tokens. Required.""" - output_tokens_details: "_models.ResponseUsageOutputTokensDetails" = rest_field( + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationUpdateParam", + "_models.LiveDecisionsDelegationUpdateParam", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: LiveClientDelegationParam, LiveResponsesDelegationUpdateParam, + LiveDecisionsDelegationUpdateParam""" + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """A detailed breakdown of the output tokens. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total number of tokens used. Required.""" + """At most one Decisions trigger per transcript event type. Triggers run independently of + delegation. On update, omit triggers to keep the current configuration, send a list to replace + it, or send an empty list to disable triggers.""" @overload def __init__( self, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: "_models.ResponseUsageInputTokensDetails", - output_tokens: int, - output_tokens_details: "_models.ResponseUsageOutputTokensDetails", - total_tokens: int, + delegation: Optional[ + Union[ + "_models.LiveClientDelegationParam", + "_models.LiveResponsesDelegationUpdateParam", + "_models.LiveDecisionsDelegationUpdateParam", + ] + ] = None, + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = None, ) -> None: ... @overload @@ -17873,33 +17937,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory search response. +class LiveSessionUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cumulative audio duration for a Live session. Values are totals for the session, not increments + to sum across usage events. - :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in - subsequent requests to perform incremental searches. Required. - :vartype search_id: str - :ivar memories: Related memory items found during the search operation. Required. - :vartype memories: list[~azure.ai.projects.models.MemorySearchItem] - :ivar usage: Usage statistics associated with the memory search operation. Required. - :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + :ivar seconds: The cumulative Live audio duration in seconds. Do not sum this value across + usage events. Required. + :vartype seconds: float """ - search_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of this search request. Use this value as previous_search_id in subsequent - requests to perform incremental searches. Required.""" - memories: list["_models.MemorySearchItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Related memory items found during the search operation. Required.""" - usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics associated with the memory search operation. Required.""" + seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cumulative Live audio duration in seconds. Do not sum this value across usage events. + Required.""" @overload def __init__( self, *, - search_id: str, - memories: list["_models.MemorySearchItem"], - usage: "_models.MemoryStoreOperationUsage", + seconds: float, ) -> None: ... @overload @@ -17913,29 +17968,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Memory update result. +class LiveSkillReferenceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveSkillReferenceParam. - :ivar memory_operations: A list of individual memory operations that were performed during the - update. Required. - :vartype memory_operations: list[~azure.ai.projects.models.MemoryOperation] - :ivar usage: Usage statistics associated with the memory update operation. Required. - :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + :ivar type: References a skill created with the /v1/skills endpoint. Required. Default value is + "skill_reference". + :vartype type: str + :ivar skill_id: The ID of the referenced skill. Required. + :vartype skill_id: str + :ivar version: + :vartype version: str """ - memory_operations: list["_models.MemoryOperation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A list of individual memory operations that were performed during the update. Required.""" - usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics associated with the memory update operation. Required.""" + type: Literal["skill_reference"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """References a skill created with the /v1/skills endpoint. Required. Default value is + \"skill_reference\".""" + skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - memory_operations: list["_models.MemoryOperation"], - usage: "_models.MemoryStoreOperationUsage", + skill_id: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -17947,227 +18004,74 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["skill_reference"] = "skill_reference" -class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Provides the status of a memory store update operation. +class LiveSpecificApplyPatchParam(_Model): # pylint: disable=docstring-missing-param + """Specific apply patch tool choice. - :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in - subsequent requests to perform incremental updates. Required. - :vartype update_id: str - :ivar status: The status of the memory update operation. One of "queued", "in_progress", - "completed", "failed", or "superseded". Required. Known values are: "queued", "in_progress", - "completed", "failed", and "superseded". - :vartype status: str or ~azure.ai.projects.models.MemoryStoreUpdateStatus - :ivar superseded_by: The update_id the operation was superseded by when status is "superseded". - :vartype superseded_by: str - :ivar result: The result of memory store update operation when status is "completed". - :vartype result: ~azure.ai.projects.models.MemoryStoreUpdateCompletedResult - :ivar error: Error object that describes the error when status is "failed". - :vartype error: ~azure.ai.projects.models.ApiError + :ivar type: The tool to call. Always ``apply_patch``. Required. Default value is "apply_patch". + :vartype type: str """ - update_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of this update request. Use this value as previous_update_id in subsequent - requests to perform incremental updates. Required.""" - status: Union[str, "_models.MemoryStoreUpdateStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", - \"failed\", or \"superseded\". Required. Known values are: \"queued\", \"in_progress\", - \"completed\", \"failed\", and \"superseded\".""" - superseded_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The update_id the operation was superseded by when status is \"superseded\".""" - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The result of memory store update operation when status is \"completed\".""" - error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error object that describes the error when status is \"failed\".""" - - @overload - def __init__( - self, - *, - update_id: str, - status: Union[str, "_models.MemoryStoreUpdateStatus"], - superseded_by: Optional[str] = None, - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, - error: Optional["_models.ApiError"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["apply_patch"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``apply_patch``. Required. Default value is \"apply_patch\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["apply_patch"] = "apply_patch" -class Metadata(_Model): - """Set of 16 key-value pairs that can be attached to an object. This can be useful for storing - additional information about the object in a structured format, and querying for objects via - API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are - strings with a maximum length of 512 characters. +class LiveSpecificCodeInterpreterParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificCodeInterpreterParam. + :ivar type: The tool to call. Always ``code_interpreter``. Required. Default value is + "code_interpreter". + :vartype type: str """ + type: Literal["code_interpreter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``code_interpreter``. Required. Default value is \"code_interpreter\".""" -class Microsoft365PermissionScopes(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A set of delegated permission scopes requested from a single resource application. + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["code_interpreter"] = "code_interpreter" - :ivar resource_app_id: Application id of the resource that exposes the requested delegated - scopes. Required. - :vartype resource_app_id: str - :ivar scopes: Delegated scope names requested from the resource application. Must not be empty. - Required. - :vartype scopes: list[str] - """ - resource_app_id: str = rest_field(name="resourceAppId", visibility=["read", "create", "update", "delete", "query"]) - """Application id of the resource that exposes the requested delegated scopes. Required.""" - scopes: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Delegated scope names requested from the resource application. Must not be empty. Required.""" +class LiveSpecificComputerParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificComputerParam. - @overload - def __init__( - self, - *, - resource_app_id: str, - scopes: list[str], - ) -> None: ... + :ivar type: The tool to call. Always ``computer``. Required. Default value is "computer". + :vartype type: str + """ - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["computer"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``computer``. Required. Default value is \"computer\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["computer"] = "computer" -class Microsoft365PublishDefaults(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Default and previously-published values used to pre-populate a Microsoft 365 publish request - for a Foundry agent. +class LiveSpecificCustomToolParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveSpecificCustomToolParam. - :ivar app_publish_scope: The publish scope. Known values are: "Personal", "Shared", and - "Tenant". - :vartype app_publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope - :ivar agent_name: The agent name. - :vartype agent_name: str - :ivar agent_display_name: The user-facing display name for the agent. Defaults to the agent - name if not previously overridden. - :vartype agent_display_name: str - :ivar app_registration_client_id: The app-registration client id associated with the agent. - :vartype app_registration_client_id: str - :ivar bot_service_arm_id: ARM resource id of the Azure Bot Service associated with the - previously-published app, if any. - :vartype bot_service_arm_id: str - :ivar app_version: The most recently published app version. - :vartype app_version: str - :ivar recommended_next_app_version: The recommended next app version (the most recent app - version, incremented). - :vartype recommended_next_app_version: str - :ivar title_id: The Microsoft 365 title id of the previously-published app, if any. - :vartype title_id: str - :ivar teams_app_id: The Microsoft Teams app id of the previously-published app, if any. - :vartype teams_app_id: str - :ivar short_description: Short, one-line description shown in the Teams app listing. - :vartype short_description: str - :ivar full_description: Full description shown on the Teams app details page. - :vartype full_description: str - :ivar developer_name: Display name of the developer / publisher. - :vartype developer_name: str - :ivar developer_website_url: Developer / publisher website URL. - :vartype developer_website_url: str - :ivar privacy_url: Privacy policy URL. - :vartype privacy_url: str - :ivar terms_of_use_url: Terms-of-use URL. - :vartype terms_of_use_url: str + :ivar type: The tool to call. Always ``custom``. Required. Default value is "custom". + :vartype type: str + :ivar name: The name of the custom tool to call. Required. + :vartype name: str """ - app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = rest_field( - name="appPublishScope", visibility=["read", "create", "update", "delete", "query"] - ) - """The publish scope. Known values are: \"Personal\", \"Shared\", and \"Tenant\".""" - agent_name: Optional[str] = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) - """The agent name.""" - agent_display_name: Optional[str] = rest_field( - name="agentDisplayName", visibility=["read", "create", "update", "delete", "query"] - ) - """The user-facing display name for the agent. Defaults to the agent name if not previously - overridden.""" - app_registration_client_id: Optional[str] = rest_field( - name="appRegistrationClientId", visibility=["read", "create", "update", "delete", "query"] - ) - """The app-registration client id associated with the agent.""" - bot_service_arm_id: Optional[str] = rest_field( - name="botServiceArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource id of the Azure Bot Service associated with the previously-published app, if any.""" - app_version: Optional[str] = rest_field( - name="appVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """The most recently published app version.""" - recommended_next_app_version: Optional[str] = rest_field( - name="recommendedNextAppVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """The recommended next app version (the most recent app version, incremented).""" - title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft 365 title id of the previously-published app, if any.""" - teams_app_id: Optional[str] = rest_field( - name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Microsoft Teams app id of the previously-published app, if any.""" - short_description: Optional[str] = rest_field( - name="shortDescription", visibility=["read", "create", "update", "delete", "query"] - ) - """Short, one-line description shown in the Teams app listing.""" - full_description: Optional[str] = rest_field( - name="fullDescription", visibility=["read", "create", "update", "delete", "query"] - ) - """Full description shown on the Teams app details page.""" - developer_name: Optional[str] = rest_field( - name="developerName", visibility=["read", "create", "update", "delete", "query"] - ) - """Display name of the developer / publisher.""" - developer_website_url: Optional[str] = rest_field( - name="developerWebsiteUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Developer / publisher website URL.""" - privacy_url: Optional[str] = rest_field( - name="privacyUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Privacy policy URL.""" - terms_of_use_url: Optional[str] = rest_field( - name="termsOfUseUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Terms-of-use URL.""" + type: Literal["custom"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``custom``. Required. Default value is \"custom\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool to call. Required.""" @overload def __init__( self, *, - app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = None, - agent_name: Optional[str] = None, - agent_display_name: Optional[str] = None, - app_registration_client_id: Optional[str] = None, - bot_service_arm_id: Optional[str] = None, - app_version: Optional[str] = None, - recommended_next_app_version: Optional[str] = None, - title_id: Optional[str] = None, - teams_app_id: Optional[str] = None, - short_description: Optional[str] = None, - full_description: Optional[str] = None, - developer_name: Optional[str] = None, - developer_website_url: Optional[str] = None, - privacy_url: Optional[str] = None, - terms_of_use_url: Optional[str] = None, + name: str, ) -> None: ... @overload @@ -18179,171 +18083,148 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["custom"] = "custom" -class Microsoft365PublishResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response from publishing an agent to Microsoft 365 / Microsoft Teams. +class LiveSpecificFileSearchParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificFileSearchParam. - :ivar title_id: The Microsoft 365 title id of the published app. - :vartype title_id: str - :ivar teams_app_id: The Microsoft Teams app id of the published app. - :vartype teams_app_id: str + :ivar type: The tool to call. Always ``file_search``. Required. Default value is "file_search". + :vartype type: str """ - title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft 365 title id of the published app.""" - teams_app_id: Optional[str] = rest_field( - name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Microsoft Teams app id of the published app.""" - - @overload - def __init__( - self, - *, - title_id: Optional[str] = None, - teams_app_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["file_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``file_search``. Required. Default value is \"file_search\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["file_search"] = "file_search" -class MicrosoftCopilotHarness(AgentHarness, discriminator="microsoft_copilot_preview"): - """The Microsoft Copilot managed harness for prompt agents. +class LiveSpecificFunctionShellParam(_Model): # pylint: disable=docstring-missing-param + """Specific shell tool choice. - :ivar type: The type of managed harness. Always ``microsoft_copilot_preview``. Required. - Default value is "microsoft_copilot_preview". + :ivar type: The tool to call. Always ``shell``. Required. Default value is "shell". :vartype type: str """ - type: Literal["microsoft_copilot_preview"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of managed harness. Always ``microsoft_copilot_preview``. Required. Default value is - \"microsoft_copilot_preview\".""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["shell"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``shell``. Required. Default value is \"shell\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "microsoft_copilot_preview" # type: ignore + self.type: Literal["shell"] = "shell" -class MicrosoftCopilotToolsetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An enablement override for a Microsoft Copilot built-in tool. +class LiveSpecificImageGenParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificImageGenParam. - :ivar name: The built-in tool to configure. Required. Known values are: "filesystem_read", - "filesystem_write", "shell", "web", and "subagents". - :vartype name: str or ~azure.ai.projects.models.MicrosoftCopilotBuiltInTool - :ivar enabled: Whether the built-in tool is enabled. If omitted, the toolset default applies. - :vartype enabled: bool + :ivar type: The tool to call. Always ``image_generation``. Required. Default value is + "image_generation". + :vartype type: str """ - name: Union[str, "_models.MicrosoftCopilotBuiltInTool"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The built-in tool to configure. Required. Known values are: \"filesystem_read\", - \"filesystem_write\", \"shell\", \"web\", and \"subagents\".""" - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the built-in tool is enabled. If omitted, the toolset default applies.""" + type: Literal["image_generation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``image_generation``. Required. Default value is \"image_generation\".""" - @overload - def __init__( - self, - *, - name: Union[str, "_models.MicrosoftCopilotBuiltInTool"], - enabled: Optional[bool] = None, - ) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["image_generation"] = "image_generation" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + +class LiveSpecificProgrammaticToolCallingParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificProgrammaticToolCallingParam. + + :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. Default value is + "programmatic_tool_calling". + :vartype type: str + """ + + type: Literal["programmatic_tool_calling"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``programmatic_tool_calling``. Required. Default value is + \"programmatic_tool_calling\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["programmatic_tool_calling"] = "programmatic_tool_calling" -class MicrosoftCopilotToolsetDefaultConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The default enablement setting for Microsoft Copilot built-in tools. +class LiveSpecificWebSearchParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificWebSearchParam. - :ivar enabled: Whether built-in tools are enabled by default. Defaults to true. - :vartype enabled: bool + :ivar type: The tool to call. Always ``web_search``. Required. Default value is "web_search". + :vartype type: str """ - enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether built-in tools are enabled by default. Defaults to true.""" + type: Literal["web_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``web_search``. Required. Default value is \"web_search\".""" - @overload - def __init__( - self, - *, - enabled: Optional[bool] = None, - ) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["web_search"] = "web_search" - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + +class LiveSpecificWebSearchPreviewParam(_Model): # pylint: disable=docstring-missing-param + """LiveSpecificWebSearchPreviewParam. + + :ivar type: The tool to call. Always ``web_search_preview``. Required. Default value is + "web_search_preview". + :vartype type: str + """ + + type: Literal["web_search_preview"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool to call. Always ``web_search_preview``. Required. Default value is + \"web_search_preview\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["web_search_preview"] = "web_search_preview" -class MicrosoftCopilotToolsetPreview( - Tool, discriminator="microsoft_copilot_toolset_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration overrides for Microsoft Copilot built-in tools. +class LiveToolSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """LiveToolSearchToolInputParam. - :ivar type: The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. - MICROSOFT_COPILOT_TOOLSET_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.MICROSOFT_COPILOT_TOOLSET_PREVIEW - :ivar default_config: The default configuration for built-in tools. If omitted, built-in tools - are enabled by default. - :vartype default_config: ~azure.ai.projects.models.MicrosoftCopilotToolsetDefaultConfig - :ivar configs: Per-tool configuration overrides. Duplicate built-in tool names are not allowed. - :vartype configs: list[~azure.ai.projects.models.MicrosoftCopilotToolsetConfig] + :ivar type: Required. Default value is "tool_search". + :vartype type: str """ - type: Literal[ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. - MICROSOFT_COPILOT_TOOLSET_PREVIEW.""" - default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The default configuration for built-in tools. If omitted, built-in tools are enabled by - default.""" - configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-tool configuration overrides. Duplicate built-in tool names are not allowed.""" + type: Literal["tool_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"tool_search\".""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["tool_search"] = "tool_search" + + +class LiveTransportCallError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LiveTransportCallError. + + :ivar type: Required. Default value is "call_error". + :vartype type: str + :ivar code: The call setup failure code. Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: The parameter related to the error, if any. Empty when no parameter applies. + :vartype param: str + """ + + type: Literal["call_error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"call_error\".""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The call setup failure code. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameter related to the error, if any. Empty when no parameter applies.""" @overload def __init__( self, *, - default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = None, - configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = None, + code: str, + message: str, + param: Optional[str] = None, ) -> None: ... @overload @@ -18355,34 +18236,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW # type: ignore + self.type: Literal["call_error"] = "call_error" -class MicrosoftFabricPreviewTool( - Tool, discriminator="fabric_dataagent_preview" +class LiveTransportDTMFReceived( + LiveServerEvent, discriminator="transport.dtmf.received" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a Microsoft Fabric tool as used to configure an agent. + """A SIP DTMF keypress received from the caller. Delivered only to sideband observers. - :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. - FABRIC_DATAAGENT_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.FABRIC_DATAAGENT_PREVIEW - :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. - :vartype fabric_dataagent_preview: ~azure.ai.projects.models.FabricDataAgentToolParameters + :ivar type: Required. TRANSPORT_DTMF_RECEIVED. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_RECEIVED + :ivar event_id: Required. + :vartype event_id: str + :ivar event: Required. + :vartype event: str """ - type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'fabric_dataagent_preview'. Required. - FABRIC_DATAAGENT_PREVIEW.""" - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The fabric data agent tool parameters. Required.""" + type: Literal[LiveServerEventType.TRANSPORT_DTMF_RECEIVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_DTMF_RECEIVED.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + event_id: str, + event: str, ) -> None: ... @overload @@ -18394,42 +18276,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore + self.type = LiveServerEventType.TRANSPORT_DTMF_RECEIVED # type: ignore -class MisalignmentErrorDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MisalignmentErrorDetailsResource. +class LiveTransportDTMFSend( + LiveServerEvent, discriminator="transport.dtmf.send" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; + this is not a client command. - :ivar error_type: An optional classification; clients must accept additional values. Known - values are: "potentially_unintended_data_transfer", "potentially_unintended_data_access", - "potentially_unintended_destructive_activity", and "other". - :vartype error_type: str or ~azure.ai.projects.models.MisalignmentErrorType - :ivar detailed_explanation: The public explanation for this block. - :vartype detailed_explanation: str - :ivar steer: An optional public continuation instruction. - :vartype steer: ~azure.ai.projects.models.MisalignmentSteer + :ivar type: Required. TRANSPORT_DTMF_SEND. + :vartype type: str or ~azure.ai.projects.models.TRANSPORT_DTMF_SEND + :ivar event_id: Required. + :vartype event_id: str + :ivar event: Required. + :vartype event: str + :ivar client_event_id: The event_id of the client command, when supplied. + :vartype client_event_id: str """ - error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """An optional classification; clients must accept additional values. Known values are: - \"potentially_unintended_data_transfer\", \"potentially_unintended_data_access\", - \"potentially_unintended_destructive_activity\", and \"other\".""" - detailed_explanation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The public explanation for this block.""" - steer: Optional["_models.MisalignmentSteer"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """An optional public continuation instruction.""" + type: Literal[LiveServerEventType.TRANSPORT_DTMF_SEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TRANSPORT_DTMF_SEND.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + event: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + client_event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event_id of the client command, when supplied.""" @overload def __init__( self, *, - error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = None, - detailed_explanation: Optional[str] = None, - steer: Optional["_models.MisalignmentSteer"] = None, + event_id: str, + event: str, + client_event_id: Optional[str] = None, ) -> None: ... @overload @@ -18441,51 +18322,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = LiveServerEventType.TRANSPORT_DTMF_SEND # type: ignore -class MisalignmentSteer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """MisalignmentSteer. +class LiveWebSearchToolInputParam(_Model): # pylint: disable=docstring-missing-param + """A web search tool available to the Live session’s Responses backend. - :ivar message: The public continuation instruction. Required. - :vartype message: str + :ivar type: The tool type. Always ``web_search``. Required. Default value is "web_search". + :vartype type: str """ - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The public continuation instruction. Required.""" - - @overload - def __init__( - self, - *, - message: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Literal["web_search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tool type. Always ``web_search``. Required. Default value is \"web_search\".""" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["web_search"] = "web_search" -class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request to fetch credentials for a model asset. +class LocalSkillParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """LocalSkillParam. - :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. - :vartype blob_uri: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar path: The path to the directory containing the skill. Required. + :vartype path: str """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI of the model asset to fetch credentials for. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the skill. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path to the directory containing the skill. Required.""" @overload def __init__( self, *, - blob_uri: str, + name: str, + description: str, + path: str, ) -> None: ... @overload @@ -18499,45 +18378,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelDeployment(Deployment, discriminator="ModelDeployment"): - """Model Deployment Definition. +class LogProbProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A log probability object. - :ivar name: Name of the deployment. Required. - :vartype name: str - :ivar type: The type of the deployment. Required. Model deployment. - :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT - :ivar model_name: Publisher-specific name of the deployed model. Required. - :vartype model_name: str - :ivar model_version: Publisher-specific version of the deployed model. Required. - :vartype model_version: str - :ivar model_publisher: Name of the deployed model's publisher. Required. - :vartype model_publisher: str - :ivar capabilities: Capabilities of deployed model. Required. - :vartype capabilities: dict[str, str] - :ivar sku: Sku of the model deployment. Required. - :vartype sku: ~azure.ai.projects.models.ModelDeploymentSku - :ivar connection_name: Name of the connection the deployment comes from. - :vartype connection_name: str + :ivar token: The token that was used to generate the log probability. Required. + :vartype token: str + :ivar logprob: The log probability of the token. Required. + :vartype logprob: float + :ivar bytes: The bytes that were used to generate the log probability. Required. + :vartype bytes: list[int] """ - type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the deployment. Required. Model deployment.""" - model_name: str = rest_field(name="modelName", visibility=["read"]) - """Publisher-specific name of the deployed model. Required.""" - model_version: str = rest_field(name="modelVersion", visibility=["read"]) - """Publisher-specific version of the deployed model. Required.""" - model_publisher: str = rest_field(name="modelPublisher", visibility=["read"]) - """Name of the deployed model's publisher. Required.""" - capabilities: dict[str, str] = rest_field(visibility=["read"]) - """Capabilities of deployed model. Required.""" - sku: "_models.ModelDeploymentSku" = rest_field(visibility=["read"]) - """Sku of the model deployment. Required.""" - connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"]) - """Name of the connection the deployment comes from.""" + token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The token that was used to generate the log probability. Required.""" + logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probability of the token. Required.""" + bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The bytes that were used to generate the log probability. Required.""" @overload def __init__( self, + *, + token: str, + logprob: float, + bytes: list[int], ) -> None: ... @overload @@ -18549,44 +18414,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore -class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Sku information. +class LoraConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment + time. - :ivar capacity: Sku capacity. Required. - :vartype capacity: int - :ivar family: Sku family. Required. - :vartype family: str - :ivar name: Sku name. Required. - :vartype name: str - :ivar size: Sku size. Required. - :vartype size: str - :ivar tier: Sku tier. Required. - :vartype tier: str + :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + :vartype rank: int + :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. + :vartype alpha: int + :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). + Auto-detected from adapter_config.json if omitted. + :vartype target_modules: list[str] + :ivar dropout: Dropout rate used during training. Informational — not used at serving time. + :vartype dropout: float """ - capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku capacity. Required.""" - family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku family. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku name. Required.""" - size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku size. Required.""" - tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku tier. Required.""" + rank: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" + alpha: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" + target_modules: Optional[list[str]] = rest_field( + name="targetModules", visibility=["read", "create", "update", "delete", "query"] + ) + """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + adapter_config.json if omitted.""" + dropout: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dropout rate used during training. Informational — not used at serving time.""" @overload def __init__( self, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str, + rank: Optional[int] = None, + alpha: Optional[int] = None, + target_modules: Optional[list[str]] = None, + dropout: Optional[float] = None, ) -> None: ... @overload @@ -18600,40 +18464,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a request for a pending upload of a model version. +class ManagedAgentIdentityBlueprintReference( + AgentBlueprintReference, discriminator="ManagedAgentIdentityBlueprint" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """ManagedAgentIdentityBlueprintReference. - :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. - :vartype pending_upload_id: str - :ivar connection_name: Azure Storage Account connection name to use for generating temporary - SAS token. - :vartype connection_name: str - :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported - for models. Required. Temporary blob reference. - :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE + :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. + :vartype type: str or ~azure.ai.projects.models.MANAGED_AGENT_IDENTITY_BLUEPRINT + :ivar blueprint_id: The ID of the managed blueprint. Required. + :vartype blueprint_id: str """ - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """If PendingUploadId is not provided, a random GUID will be used.""" - connection_name: Optional[str] = rest_field( - name="connectionName", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + blueprint_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the managed blueprint. Required.""" @overload def __init__( self, *, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + blueprint_id: str, ) -> None: ... @overload @@ -18645,47 +18496,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT # type: ignore -class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the response for a model pending upload request. +class ManagedAzureAISearchIndex( + Index, discriminator="ManagedAzureSearch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed Azure AI Search Index Definition. - :ivar blob_reference: Container-level read, write, list SAS. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference - :ivar pending_upload_id: ID for this upload request. Required. - :vartype pending_upload_id: str - :ivar version: Version of asset to be created if user did not specify version when initially - creating upload. + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. :vartype version: str - :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported - for models. Required. Temporary blob reference. - :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Managed Azure Search. + :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH + :ivar vector_store_id: Vector store id of managed index. Required. + :vartype vector_store_id: str """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] - ) - """Container-level read, write, list SAS. Required.""" - pending_upload_id: str = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """ID for this upload request. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of asset to be created if user did not specify version when initially creating upload.""" - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. - Temporary blob reference.""" + type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Managed Azure Search.""" + vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) + """Vector store id of managed index. Required.""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], - version: Optional[str] = None, + vector_store_id: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -18697,39 +18543,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore -class ModelSamplingParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a set of parameters used to control the sampling behavior of a language model during - text generation. +class MCPListToolsTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP list tools tool. - :ivar temperature: The temperature parameter for sampling. Defaults to 1.0. - :vartype temperature: float - :ivar top_p: The top-p parameter for nucleus sampling. Defaults to 1.0. - :vartype top_p: float - :ivar seed: The random seed for reproducibility. Defaults to 42. - :vartype seed: int - :ivar max_completion_tokens: The maximum number of tokens allowed in the completion. - :vartype max_completion_tokens: int + :ivar name: The name of the tool. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar input_schema: The JSON schema describing the tool's input. Required. + :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema + :ivar annotations: + :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations """ - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The temperature parameter for sampling. Defaults to 1.0.""" - top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The top-p parameter for nucleus sampling. Defaults to 1.0.""" - seed: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The random seed for reproducibility. Defaults to 42.""" - max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of tokens allowed in the completion.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - seed: Optional[int] = None, - max_completion_tokens: Optional[int] = None, + name: str, + input_schema: "_models.MCPListToolsToolInputSchema", + description: Optional[str] = None, + annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, ) -> None: ... @overload @@ -18743,29 +18591,176 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Source information for the model. +class MCPListToolsToolAnnotations(_Model): + """MCPListToolsToolAnnotations.""" - :ivar source_type: The source type of the model. Known values are: "LocalUpload" and - "TrainingJob". - :vartype source_type: str or ~azure.ai.projects.models.FoundryModelSourceType - :ivar job_id: The job ID that produced this model. - :vartype job_id: str - """ - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( - name="sourceType", visibility=["read", "create", "update", "delete", "query"] - ) - """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" - job_id: Optional[str] = rest_field(name="jobId", visibility=["read", "create", "update", "delete", "query"]) - """The job ID that produced this model.""" +class MCPListToolsToolInputSchema(_Model): + """MCPListToolsToolInputSchema.""" + + +class McpProtocolConfiguration(_Model): + """Configuration specific to the MCP protocol.""" + + +class MCPTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. Default value is "mcp". + :vartype type: str + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + """ + + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the MCP tool. Always ``mcp``. Required. Default value is \"mcp\".""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, - job_id: Optional[str] = None, + server_label: str, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + tunnel_id: Optional[str] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, + project_connection_id: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -18777,80 +18772,170 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["mcp"] = "mcp" -class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Model Version Definition. +class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only + """An MCP tool stored in a toolbox. - :ivar blob_uri: URI of the model artifact in blob storage. Required. - :vartype blob_uri: str - :ivar weight_type: The weight type of the model. Known values are: "FullWeight", "LoRA", and - "DraftModel". - :vartype weight_type: str or ~azure.ai.projects.models.FoundryModelWeightType - :ivar base_model: Base model asset ID. - :vartype base_model: str - :ivar source: The source of the model. - :vartype source: ~azure.ai.projects.models.ModelSourceData - :ivar lora_config: Adapter-specific configuration. Required when weight_type is lora; ignored - otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — - user-provided values take precedence over auto-detected values. - :vartype lora_config: ~azure.ai.projects.models.LoraConfig - :ivar artifact_profile: The artifact profile of the model. - :vartype artifact_profile: ~azure.ai.projects.models.ArtifactProfile - :ivar warnings: Service-computed advisory warnings derived from the artifact profile. - :vartype warnings: list[~azure.ai.projects.models.FoundryModelWarning] - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """URI of the model artifact in blob storage. Required.""" - weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = rest_field( - name="weightType", visibility=["read", "create", "update", "delete", "query"] + type: Literal[ToolboxToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MCP.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" - base_model: Optional[str] = rest_field(name="baseModel", visibility=["read", "create"]) - """Base model asset ID.""" - source: Optional["_models.ModelSourceData"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source of the model.""" - lora_config: Optional["_models.LoraConfig"] = rest_field(name="loraConfig", visibility=["read", "create"]) - """Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be - auto-populated from adapter_config.json when present in the uploaded files — user-provided - values take precedence over auto-detected values.""" - artifact_profile: Optional["_models.ArtifactProfile"] = rest_field(name="artifactProfile", visibility=["read"]) - """The artifact profile of the model.""" - warnings: Optional[list["_models.FoundryModelWarning"]] = rest_field(visibility=["read"]) - """Service-computed advisory warnings derived from the artifact profile.""" - id: Optional[str] = rest_field(visibility=["read"]) - """Asset ID, a unique identifier for the asset.""" - name: str = rest_field(visibility=["read"]) - """The name of the resource. Required.""" - version: str = rest_field(visibility=["read"]) - """The version of the resource. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" @overload def __init__( self, *, - blob_uri: str, - weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = None, - base_model: Optional[str] = None, - source: Optional["_models.ModelSourceData"] = None, - lora_config: Optional["_models.LoraConfig"] = None, + server_label: str, + name: Optional[str] = None, description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + tunnel_id: Optional[str] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, + project_connection_id: Optional[str] = None, ) -> None: ... @overload @@ -18862,31 +18947,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.MCP # type: ignore -class MonthlyRecurrenceSchedule( - RecurrenceSchedule, discriminator="Monthly" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Monthly recurrence schedule. +class MCPToolFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool filter. - :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.MONTHLY - :ivar days_of_month: Days of the month for the recurrence schedule. Required. - :vartype days_of_month: list[int] + :ivar tool_names: MCP allowed tools. + :vartype tool_names: list[str] + :ivar read_only: Indicates whether or not a tool modifies data or is read-only. If an MCP + server is `annotated with `readOnlyHint` + `_, + it will match this filter. + :vartype read_only: bool """ - type: Literal[RecurrenceType.MONTHLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Monthly recurrence type. Required. Monthly recurrence pattern.""" - days_of_month: list[int] = rest_field( - name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] - ) - """Days of the month for the recurrence schedule. Required.""" + tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MCP allowed tools.""" + read_only: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether or not a tool modifies data or is read-only. If an MCP server is `annotated + with `readOnlyHint` + `_, + it will match this filter.""" @overload def __init__( self, *, - days_of_month: list[int], + tool_names: Optional[list[str]] = None, + read_only: Optional[bool] = None, ) -> None: ... @overload @@ -18898,43 +18987,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.MONTHLY # type: ignore -class NamespaceToolParam( - Tool, discriminator="namespace" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Namespace. +class MCPToolRequireApproval(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCPToolRequireApproval. - :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. - :vartype type: str or ~azure.ai.projects.models.NAMESPACE - :ivar name: The namespace name used in tool calls (for example, ``crm``). Required. - :vartype name: str - :ivar description: A description of the namespace shown to the model. Required. - :vartype description: str - :ivar tools: The function/custom tools available inside this namespace. Required. - :vartype tools: list[~azure.ai.projects.models.FunctionToolParam or - ~azure.ai.projects.models.CustomToolParam] + :ivar always: + :vartype always: ~azure.ai.projects.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.projects.models.MCPToolFilter """ - type: Literal[ToolType.NAMESPACE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace name used in tool calls (for example, ``crm``). Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of the namespace shown to the model. Required.""" - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The function/custom tools available inside this namespace. Required.""" + always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: str, - description: str, - tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = None, ) -> None: ... @overload @@ -18946,22 +19018,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.NAMESPACE # type: ignore -class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): - """Credentials that do not require authentication. +class MemoryOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a single memory operation (create, update, or delete) performed on a memory item. - :ivar type: The credential type. Required. No credential. - :vartype type: str or ~azure.ai.projects.models.NONE + :ivar kind: The type of memory operation being performed. Required. Known values are: "create", + "update", and "delete". + :vartype kind: str or ~azure.ai.projects.models.MemoryOperationKind + :ivar memory_item: The memory item to create, update, or delete. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem """ - type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. No credential.""" + kind: Union[str, "_models.MemoryOperationKind"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of memory operation being performed. Required. Known values are: \"create\", + \"update\", and \"delete\".""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory item to create, update, or delete. Required.""" @overload def __init__( self, + *, + kind: Union[str, "_models.MemoryOperationKind"], + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -18973,35 +19055,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.NONE # type: ignore -class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only - """One-time trigger. +class MemorySearchItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A retrieved memory item from memory search. - :ivar type: Required. One-time trigger. - :vartype type: str or ~azure.ai.projects.models.ONE_TIME - :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. - :vartype trigger_at: ~datetime.datetime - :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. - :vartype time_zone: str + :ivar memory_item: Retrieved memory item. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem """ - type: Literal[TriggerType.ONE_TIME] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. One-time trigger.""" - trigger_at: datetime.datetime = rest_field( - name="triggerAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time for the one-time trigger in ISO 8601 format. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the one-time trigger. Defaults to ``UTC``.""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Retrieved memory item. Required.""" @overload def __init__( self, *, - trigger_at: datetime.datetime, - time_zone: Optional[str] = None, + memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -19013,30 +19083,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.ONE_TIME # type: ignore - -class OpenApiAuthDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """authentication details for OpenApiFunctionDefinition. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails +class MemorySearchOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search options. - :ivar type: The type of authentication, must be anonymous/project_connection/managed_identity. - Required. Known values are: "anonymous", "project_connection", and "managed_identity". - :vartype type: str or ~azure.ai.projects.models.OpenApiAuthType + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of authentication, must be anonymous/project_connection/managed_identity. Required. - Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" - + max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of memory items to return.""" + @overload def __init__( self, *, - type: str, + max_memories: Optional[int] = None, ) -> None: ... @overload @@ -19050,19 +19113,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): - """Security details for OpenApi anonymous authentication. +class MemorySearchPreviewTool( + Tool, discriminator="memory_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A tool for integrating memories into the agent. - :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. - :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + :ivar type: The type of the tool. Always ``memory_search_preview``. Required. + MEMORY_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_PREVIEW + :ivar memory_store_name: The name of the memory store to use. Required. + :vartype memory_store_name: str + :ivar scope: The namespace used to group and isolate memories, such as a user ID. Limits which + memories can be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to + the current signed-in user. Required. + :vartype scope: str + :ivar search_options: Options for searching the memory store. + :vartype search_options: ~azure.ai.projects.models.MemorySearchOptions + :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default + 300. + :vartype update_delay: int """ - type: Literal[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" + memory_store_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store to use. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace used to group and isolate memories, such as a user ID. Limits which memories can + be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to the current + signed-in user. Required.""" + search_options: Optional["_models.MemorySearchOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Options for searching the memory store.""" + update_delay: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Time to wait before updating memories after inactivity (seconds). Default 300.""" @overload def __init__( self, + *, + memory_store_name: str, + scope: str, + search_options: Optional["_models.MemorySearchOptions"] = None, + update_delay: Optional[int] = None, ) -> None: ... @overload @@ -19074,50 +19168,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.ANONYMOUS # type: ignore + self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore -class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an openapi function. +class MemoryStoreDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base definition for memory store configurations. - :ivar name: The name of the function to be called. Required. - :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. - :vartype description: str - :ivar spec: The openapi function shape, described as a JSON Schema object. Required. - :vartype spec: dict[str, any] - :ivar auth: Open API authentication details. Required. - :vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails - :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. - :vartype default_params: list[str] - :ivar functions: List of function definitions used by OpenApi tool. - :vartype functions: list[~azure.ai.projects.models.OpenApiFunctionDefinitionFunction] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + MemoryStoreDefaultDefinition + + :ivar kind: The kind of the memory store. Required. "default" + :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - spec: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The openapi function shape, described as a JSON Schema object. Required.""" - auth: "_models.OpenApiAuthDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Open API authentication details. Required.""" - default_params: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of OpenAPI spec parameters that will use user-provided defaults.""" - functions: Optional[list["_models.OpenApiFunctionDefinitionFunction"]] = rest_field(visibility=["read"]) - """List of function definitions used by OpenApi tool.""" + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory store. Required. \"default\"""" @overload def __init__( self, *, - name: str, - spec: dict[str, Any], - auth: "_models.OpenApiAuthDetails", - description: Optional[str] = None, - default_params: Optional[list[str]] = None, + kind: str, ) -> None: ... @overload @@ -19131,34 +19203,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """OpenApiFunctionDefinitionFunction. +class MemoryStoreDefaultDefinition( + MemoryStoreDefinition, discriminator="default" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store implementation. - :ivar name: The name of the function to be called. Required. - :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. - :vartype description: str - :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. - Required. - :vartype parameters: dict[str, any] + :ivar kind: The kind of the memory store. Required. The default memory store implementation. + :vartype kind: str or ~azure.ai.projects.models.DEFAULT + :ivar chat_model: The name or identifier of the chat completion model deployment used for + memory processing. Required. + :vartype chat_model: str + :ivar embedding_model: The name or identifier of the embedding model deployment used for memory + processing. Required. + :vartype embedding_model: str + :ivar options: Default memory store options. + :vartype options: ~azure.ai.projects.models.MemoryStoreDefaultOptions """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parameters the functions accepts, described as a JSON Schema object. Required.""" + kind: Literal[MemoryStoreKind.DEFAULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory store. Required. The default memory store implementation.""" + chat_model: str = rest_field(visibility=["read", "create"]) + """The name or identifier of the chat completion model deployment used for memory processing. + Required.""" + embedding_model: str = rest_field(visibility=["read", "create"]) + """The name or identifier of the embedding model deployment used for memory processing. Required.""" + options: Optional["_models.MemoryStoreDefaultOptions"] = rest_field(visibility=["read", "create"]) + """Default memory store options.""" @overload def __init__( self, *, - name: str, - parameters: dict[str, Any], - description: Optional[str] = None, + chat_model: str, + embedding_model: str, + options: Optional["_models.MemoryStoreDefaultOptions"] = None, ) -> None: ... @overload @@ -19170,31 +19248,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = MemoryStoreKind.DEFAULT # type: ignore -class OpenApiManagedAuthDetails( - OpenApiAuthDetails, discriminator="managed_identity" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security details for OpenApi managed_identity authentication. +class MemoryStoreDefaultOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default memory store configurations. - :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. - :vartype type: str or ~azure.ai.projects.models.MANAGED_IDENTITY - :ivar security_scheme: Connection auth security details. Required. - :vartype security_scheme: ~azure.ai.projects.models.OpenApiManagedSecurityScheme + :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is + true. Required. + :vartype user_profile_enabled: bool + :ivar user_profile_details: Specific categories or types of user profile information to extract + and store. + :vartype user_profile_details: str + :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Defaults to + ``true``. Required. + :vartype chat_summary_enabled: bool + :ivar procedural_memory_enabled: Whether to enable procedural memory extraction and storage. + The service defaults to ``true`` if a value is not specified by the caller. + :vartype procedural_memory_enabled: bool + :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of ``0`` + indicates that memories do not expire. Defaults to ``0``. + :vartype default_ttl_seconds: ~datetime.timedelta """ - type: Literal[OpenApiAuthType.MANAGED_IDENTITY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" - security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + user_profile_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable user profile extraction and storage. Default is true. Required.""" + user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specific categories or types of user profile information to extract and store.""" + chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" + procedural_memory_enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable procedural memory extraction and storage. The service defaults to ``true`` if + a value is not specified by the caller.""" + default_ttl_seconds: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" ) - """Connection auth security details. Required.""" + """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do + not expire. Defaults to ``0``.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiManagedSecurityScheme", + user_profile_enabled: bool, + chat_summary_enabled: bool, + user_profile_details: Optional[str] = None, + procedural_memory_enabled: Optional[bool] = None, + default_ttl_seconds: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -19206,24 +19306,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore -class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security scheme for OpenApi managed_identity authentication. +class MemoryStoreDeleteScopeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response for deleting memories from a scope. - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: str + :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. + MEMORY_STORE_SCOPE_DELETED. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE_SCOPE_DELETED + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar scope: The scope from which memories were deleted. Required. + :vartype scope: str + :ivar deleted: Whether the deletion operation was successful. Required. + :vartype deleted: bool """ - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Authentication scope for managed_identity auth type. Required.""" + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type. Always 'memory_store.scope.deleted'. Required. MEMORY_STORE_SCOPE_DELETED.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The scope from which memories were deleted. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the deletion operation was successful. Required.""" @overload def __init__( self, *, - audience: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + name: str, + scope: str, + deleted: bool, ) -> None: ... @overload @@ -19237,30 +19354,63 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails( - OpenApiAuthDetails, discriminator="project_connection" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security details for OpenApi project connection authentication. +class MemoryStoreDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A memory store that can store and retrieve user memories. - :ivar type: The object type, which is always 'project_connection'. Required. - PROJECT_CONNECTION. - :vartype type: str or ~azure.ai.projects.models.PROJECT_CONNECTION - :ivar security_scheme: Project connection auth security details. Required. - :vartype security_scheme: ~azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme + :ivar object: The object type, which is always 'memory_store'. Required. MEMORY_STORE. + :vartype object: str or ~azure.ai.projects.models.MEMORY_STORE + :ivar id: The unique identifier of the memory store. Required. + :vartype id: str + :ivar created_at: The Unix timestamp (seconds) when the memory store was created. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The Unix timestamp (seconds) when the memory store was last updated. + Required. + :vartype updated_at: ~datetime.datetime + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar description: A human-readable description of the memory store. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the memory store. + :vartype metadata: dict[str, str] + :ivar definition: The definition of the memory store. Required. + :vartype definition: ~azure.ai.projects.models.MemoryStoreDefinition """ - type: Literal[OpenApiAuthType.PROJECT_CONNECTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( + object: Literal[MemoryStoreObjectType.MEMORY_STORE] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Project connection auth security details. Required.""" + """The object type, which is always 'memory_store'. Required. MEMORY_STORE.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the memory store. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the memory store was created. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the memory store was last updated. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the memory store.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Arbitrary key-value metadata to associate with the memory store.""" + definition: "_models.MemoryStoreDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The definition of the memory store. Required.""" @overload def __init__( self, *, - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + object: Literal[MemoryStoreObjectType.MEMORY_STORE], + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + updated_at: datetime.datetime, + name: str, + definition: "_models.MemoryStoreDefinition", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -19272,24 +19422,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Security scheme for OpenApi managed_identity authentication. +class MemoryStoreOperationUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Usage statistics of a memory store operation. - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_id: str + :ivar embedding_tokens: The number of embedding tokens. Required. + :vartype embedding_tokens: int + :ivar input_tokens: The number of input tokens. Required. + :vartype input_tokens: int + :ivar input_tokens_details: A detailed breakdown of the input tokens. Required. + :vartype input_tokens_details: ~azure.ai.projects.models.ResponseUsageInputTokensDetails + :ivar output_tokens: The number of output tokens. Required. + :vartype output_tokens: int + :ivar output_tokens_details: A detailed breakdown of the output tokens. Required. + :vartype output_tokens_details: ~azure.ai.projects.models.ResponseUsageOutputTokensDetails + :ivar total_tokens: The total number of tokens used. Required. + :vartype total_tokens: int """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for Project Connection auth type. Required.""" + embedding_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of embedding tokens. Required.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input tokens. Required.""" + input_tokens_details: "_models.ResponseUsageInputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the input tokens. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of output tokens. Required.""" + output_tokens_details: "_models.ResponseUsageOutputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the output tokens. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total number of tokens used. Required.""" @overload def __init__( self, *, - project_connection_id: str, + embedding_tokens: int, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, ) -> None: ... @overload @@ -19303,35 +19481,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiTool(Tool, discriminator="openapi"): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for an OpenAPI tool as used to configure an agent. +class MemoryStoreSearchResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory search response. - :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. - :vartype type: str or ~azure.ai.projects.models.OPENAPI - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar openapi: The openapi function definition. Required. - :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition + :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in + subsequent requests to perform incremental searches. Required. + :vartype search_id: str + :ivar memories: Related memory items found during the search operation. Required. + :vartype memories: list[~azure.ai.projects.models.MemorySearchItem] + :ivar usage: Usage statistics associated with the memory search operation. Required. + :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage """ - type: Literal[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'openapi'. Required. OPENAPI.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - openapi: "_models.OpenApiFunctionDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The openapi function definition. Required.""" + search_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this search request. Use this value as previous_search_id in subsequent + requests to perform incremental searches. Required.""" + memories: list["_models.MemorySearchItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Related memory items found during the search operation. Required.""" + usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage statistics associated with the memory search operation. Required.""" @overload def __init__( self, *, - openapi: "_models.OpenApiFunctionDefinition", - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + search_id: str, + memories: list["_models.MemorySearchItem"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -19343,43 +19519,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.OPENAPI # type: ignore -class OpenApiToolboxTool( - ToolboxTool, discriminator="openapi" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OpenAPI tool stored in a toolbox. +class MemoryStoreUpdateCompletedResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Memory update result. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. OPENAPI. - :vartype type: str or ~azure.ai.projects.models.OPENAPI - :ivar openapi: The openapi function definition. Required. - :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition + :ivar memory_operations: A list of individual memory operations that were performed during the + update. Required. + :vartype memory_operations: list[~azure.ai.projects.models.MemoryOperation] + :ivar usage: Usage statistics associated with the memory update operation. Required. + :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage """ - type: Literal[ToolboxToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. OPENAPI.""" - openapi: "_models.OpenApiFunctionDefinition" = rest_field( + memory_operations: list["_models.MemoryOperation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The openapi function definition. Required.""" + """A list of individual memory operations that were performed during the update. Required.""" + usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage statistics associated with the memory update operation. Required.""" @overload def __init__( self, *, - openapi: "_models.OpenApiFunctionDefinition", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + memory_operations: list["_models.MemoryOperation"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -19391,28 +19555,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.OPENAPI # type: ignore - -class OptimizationContext(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base model for typed optimization context. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - SteeringPromptOptimizationContext +class MemoryStoreUpdateResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Provides the status of a memory store update operation. - :ivar type: Optimization context type discriminator. Required. "steering_prompt" - :vartype type: str or ~azure.ai.projects.models.OptimizationContextType + :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in + subsequent requests to perform incremental updates. Required. + :vartype update_id: str + :ivar status: The status of the memory update operation. One of "queued", "in_progress", + "completed", "failed", or "superseded". Required. Known values are: "queued", "in_progress", + "completed", "failed", and "superseded". + :vartype status: str or ~azure.ai.projects.models.MemoryStoreUpdateStatus + :ivar superseded_by: The update_id the operation was superseded by when status is "superseded". + :vartype superseded_by: str + :ivar result: The result of memory store update operation when status is "completed". + :vartype result: ~azure.ai.projects.models.MemoryStoreUpdateCompletedResult + :ivar error: Error object that describes the error when status is "failed". + :vartype error: ~azure.ai.projects.models.ApiError """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Optimization context type discriminator. Required. \"steering_prompt\"""" + update_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this update request. Use this value as previous_update_id in subsequent + requests to perform incremental updates. Required.""" + status: Union[str, "_models.MemoryStoreUpdateStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", + \"failed\", or \"superseded\". Required. Known values are: \"queued\", \"in_progress\", + \"completed\", \"failed\", and \"superseded\".""" + superseded_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The update_id the operation was superseded by when status is \"superseded\".""" + result: Optional["_models.MemoryStoreUpdateCompletedResult"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The result of memory store update operation when status is \"completed\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error object that describes the error when status is \"failed\".""" @overload def __init__( self, *, - type: str, + update_id: str, + status: Union[str, "_models.MemoryStoreUpdateStatus"], + superseded_by: Optional[str] = None, + result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, + error: Optional["_models.ApiError"] = None, ) -> None: ... @overload @@ -19426,40 +19615,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A telemetry export endpoint configuration. +class Metadata(_Model): + """Set of 16 key-value pairs that can be attached to an object. This can be useful for storing + additional information about the object in a structured format, and querying for objects via + API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are + strings with a maximum length of 512 characters. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OtlpTelemetryEndpoint + """ - :ivar kind: The telemetry export endpoint kind. Required. "OTLP" - :vartype kind: str or ~azure.ai.projects.models.TelemetryEndpointKind - :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + +class Microsoft365PermissionScopes(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A set of delegated permission scopes requested from a single resource application. + + :ivar resource_app_id: Application id of the resource that exposes the requested delegated + scopes. Required. + :vartype resource_app_id: str + :ivar scopes: Delegated scope names requested from the resource application. Must not be empty. Required. - :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] - :ivar auth: Optional authentication configuration. - :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth + :vartype scopes: list[str] """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The telemetry export endpoint kind. Required. \"OTLP\"""" - data: list[Union[str, "_models.TelemetryDataKind"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Data types to export to this endpoint. Use an empty array to export no data. Required.""" - auth: Optional["_models.TelemetryEndpointAuth"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional authentication configuration.""" + resource_app_id: str = rest_field(name="resourceAppId", visibility=["read", "create", "update", "delete", "query"]) + """Application id of the resource that exposes the requested delegated scopes. Required.""" + scopes: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Delegated scope names requested from the resource application. Must not be empty. Required.""" @overload def __init__( self, *, - kind: str, - data: list[Union[str, "_models.TelemetryDataKind"]], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + resource_app_id: str, + scopes: list[str], ) -> None: ... @overload @@ -19473,45 +19659,123 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OtlpTelemetryEndpoint( - TelemetryEndpoint, discriminator="OTLP" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. +class Microsoft365PublishDefaults(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Default and previously-published values used to pre-populate a Microsoft 365 publish request + for a Foundry agent. - :ivar data: Data types to export to this endpoint. Use an empty array to export no data. - Required. - :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] - :ivar auth: Optional authentication configuration. - :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth - :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. - OpenTelemetry Protocol (OTLP) endpoint. - :vartype kind: str or ~azure.ai.projects.models.OTLP - :ivar endpoint: The OTLP collector endpoint URL. Required. - :vartype endpoint: str - :ivar protocol: The transport protocol for the OTLP endpoint. Required. Known values are: - "Http" and "Grpc". - :vartype protocol: str or ~azure.ai.projects.models.TelemetryTransportProtocol + :ivar app_publish_scope: The publish scope. Known values are: "Personal", "Shared", and + "Tenant". + :vartype app_publish_scope: str or ~azure.ai.projects.models.Microsoft365PublishScope + :ivar agent_name: The agent name. + :vartype agent_name: str + :ivar agent_display_name: The user-facing display name for the agent. Defaults to the agent + name if not previously overridden. + :vartype agent_display_name: str + :ivar app_registration_client_id: The app-registration client id associated with the agent. + :vartype app_registration_client_id: str + :ivar bot_service_arm_id: ARM resource id of the Azure Bot Service associated with the + previously-published app, if any. + :vartype bot_service_arm_id: str + :ivar app_version: The most recently published app version. + :vartype app_version: str + :ivar recommended_next_app_version: The recommended next app version (the most recent app + version, incremented). + :vartype recommended_next_app_version: str + :ivar title_id: The Microsoft 365 title id of the previously-published app, if any. + :vartype title_id: str + :ivar teams_app_id: The Microsoft Teams app id of the previously-published app, if any. + :vartype teams_app_id: str + :ivar short_description: Short, one-line description shown in the Teams app listing. + :vartype short_description: str + :ivar full_description: Full description shown on the Teams app details page. + :vartype full_description: str + :ivar developer_name: Display name of the developer / publisher. + :vartype developer_name: str + :ivar developer_website_url: Developer / publisher website URL. + :vartype developer_website_url: str + :ivar privacy_url: Privacy policy URL. + :vartype privacy_url: str + :ivar terms_of_use_url: Terms-of-use URL. + :vartype terms_of_use_url: str """ - kind: Literal[TelemetryEndpointKind.OTLP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry - Protocol (OTLP) endpoint.""" - endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The OTLP collector endpoint URL. Required.""" - protocol: Union[str, "_models.TelemetryTransportProtocol"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = rest_field( + name="appPublishScope", visibility=["read", "create", "update", "delete", "query"] ) - """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and - \"Grpc\".""" + """The publish scope. Known values are: \"Personal\", \"Shared\", and \"Tenant\".""" + agent_name: Optional[str] = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) + """The agent name.""" + agent_display_name: Optional[str] = rest_field( + name="agentDisplayName", visibility=["read", "create", "update", "delete", "query"] + ) + """The user-facing display name for the agent. Defaults to the agent name if not previously + overridden.""" + app_registration_client_id: Optional[str] = rest_field( + name="appRegistrationClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """The app-registration client id associated with the agent.""" + bot_service_arm_id: Optional[str] = rest_field( + name="botServiceArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the Azure Bot Service associated with the previously-published app, if any.""" + app_version: Optional[str] = rest_field( + name="appVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The most recently published app version.""" + recommended_next_app_version: Optional[str] = rest_field( + name="recommendedNextAppVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The recommended next app version (the most recent app version, incremented).""" + title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft 365 title id of the previously-published app, if any.""" + teams_app_id: Optional[str] = rest_field( + name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Microsoft Teams app id of the previously-published app, if any.""" + short_description: Optional[str] = rest_field( + name="shortDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Short, one-line description shown in the Teams app listing.""" + full_description: Optional[str] = rest_field( + name="fullDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Full description shown on the Teams app details page.""" + developer_name: Optional[str] = rest_field( + name="developerName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display name of the developer / publisher.""" + developer_website_url: Optional[str] = rest_field( + name="developerWebsiteUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Developer / publisher website URL.""" + privacy_url: Optional[str] = rest_field( + name="privacyUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Privacy policy URL.""" + terms_of_use_url: Optional[str] = rest_field( + name="termsOfUseUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Terms-of-use URL.""" @overload def __init__( self, *, - data: list[Union[str, "_models.TelemetryDataKind"]], - endpoint: str, - protocol: Union[str, "_models.TelemetryTransportProtocol"], - auth: Optional["_models.TelemetryEndpointAuth"] = None, + app_publish_scope: Optional[Union[str, "_models.Microsoft365PublishScope"]] = None, + agent_name: Optional[str] = None, + agent_display_name: Optional[str] = None, + app_registration_client_id: Optional[str] = None, + bot_service_arm_id: Optional[str] = None, + app_version: Optional[str] = None, + recommended_next_app_version: Optional[str] = None, + title_id: Optional[str] = None, + teams_app_id: Optional[str] = None, + short_description: Optional[str] = None, + full_description: Optional[str] = None, + developer_name: Optional[str] = None, + developer_website_url: Optional[str] = None, + privacy_url: Optional[str] = None, + terms_of_use_url: Optional[str] = None, ) -> None: ... @overload @@ -19523,43 +19787,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelemetryEndpointKind.OTLP # type: ignore -class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a request for a pending upload. +class Microsoft365PublishResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from publishing an agent to Microsoft 365 / Microsoft Teams. - :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. - :vartype pending_upload_id: str - :ivar connection_name: Azure Storage Account connection name to use for generating temporary - SAS token. - :vartype connection_name: str - :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never - read this value and silently ignored it. Use TemporaryBlobReference instead. - :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE + :ivar title_id: The Microsoft 365 title id of the published app. + :vartype title_id: str + :ivar teams_app_id: The Microsoft Teams app id of the published app. + :vartype teams_app_id: str """ - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """If PendingUploadId is not provided, a random GUID will be used.""" - connection_name: Optional[str] = rest_field( - name="connectionName", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + title_id: Optional[str] = rest_field(name="titleId", visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft 365 title id of the published app.""" + teams_app_id: Optional[str] = rest_field( + name="teamsAppId", visibility=["read", "create", "update", "delete", "query"] ) - """The type of pending upload. Required. Deprecated: the service never read this value and - silently ignored it. Use TemporaryBlobReference instead.""" + """The Microsoft Teams app id of the published app.""" @overload def __init__( self, *, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + title_id: Optional[str] = None, + teams_app_id: Optional[str] = None, ) -> None: ... @overload @@ -19573,45 +19824,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the response for a pending upload request. +class MicrosoftCopilotHarness(AgentHarness, discriminator="microsoft_copilot_preview"): + """The Microsoft Copilot managed harness for prompt agents. - :ivar blob_reference: Container-level read, write, list SAS. Required. - :vartype blob_reference: ~azure.ai.projects.models.BlobReference - :ivar pending_upload_id: ID for this upload request. Required. - :vartype pending_upload_id: str - :ivar version: Version of asset to be created if user did not specify version when initially - creating upload. - :vartype version: str - :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never - read this value and silently ignored it. Use TemporaryBlobReference instead. - :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE + :ivar type: The type of managed harness. Always ``microsoft_copilot_preview``. Required. + Default value is "microsoft_copilot_preview". + :vartype type: str """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] - ) - """Container-level read, write, list SAS. Required.""" - pending_upload_id: str = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """ID for this upload request. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of asset to be created if user did not specify version when initially creating upload.""" - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of pending upload. Required. Deprecated: the service never read this value and - silently ignored it. Use TemporaryBlobReference instead.""" + type: Literal["microsoft_copilot_preview"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of managed harness. Always ``microsoft_copilot_preview``. Required. Default value is + \"microsoft_copilot_preview\".""" @overload def __init__( self, - *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = None, ) -> None: ... @overload @@ -19623,25 +19850,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "microsoft_copilot_preview" # type: ignore -class PickPropertiesVoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The template for picking properties. +class MicrosoftCopilotToolsetConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An enablement override for a Microsoft Copilot built-in tool. - :ivar output: Output (agent speech) audio configuration. - :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig + :ivar name: The built-in tool to configure. Required. Known values are: "filesystem_read", + "filesystem_write", "shell", "web", and "subagents". + :vartype name: str or ~azure.ai.projects.models.MicrosoftCopilotBuiltInTool + :ivar enabled: Whether the built-in tool is enabled. If omitted, the toolset default applies. + :vartype enabled: bool """ - output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( + name: Union[str, "_models.MicrosoftCopilotBuiltInTool"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Output (agent speech) audio configuration.""" + """The built-in tool to configure. Required. Known values are: \"filesystem_read\", + \"filesystem_write\", \"shell\", \"web\", and \"subagents\".""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the built-in tool is enabled. If omitted, the toolset default applies.""" @overload def __init__( self, *, - output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, + name: Union[str, "_models.MicrosoftCopilotBuiltInTool"], + enabled: Optional[bool] = None, ) -> None: ... @overload @@ -19655,36 +19890,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProceduralMemoryItem( - MemoryItem, discriminator="procedural" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A memory item containing a procedure extracted from conversations. +class MicrosoftCopilotToolsetDefaultConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The default enablement setting for Microsoft Copilot built-in tools. - :ivar memory_id: The unique ID of the memory item. Required. - :vartype memory_id: str - :ivar updated_at: The last update time of the memory item. Required. - :vartype updated_at: ~datetime.datetime - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar content: The content of the memory. Required. - :vartype content: str - :ivar kind: The kind of the memory item. Required. Routine procedures extracted from - conversations. - :vartype kind: str or ~azure.ai.projects.models.PROCEDURAL + :ivar enabled: Whether built-in tools are enabled by default. Defaults to true. + :vartype enabled: bool """ - kind: Literal[MemoryItemKind.PROCEDURAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. Routine procedures extracted from conversations.""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether built-in tools are enabled by default. Defaults to true.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + enabled: Optional[bool] = None, ) -> None: ... @overload @@ -19696,24 +19916,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.PROCEDURAL # type: ignore -class ProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): - """ProgrammaticToolCallingParam. +class MicrosoftCopilotToolsetPreview( + Tool, discriminator="microsoft_copilot_toolset_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration overrides for Microsoft Copilot built-in tools. - :ivar type: The type of the tool. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING. - :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING + :ivar type: The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. + MICROSOFT_COPILOT_TOOLSET_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.MICROSOFT_COPILOT_TOOLSET_PREVIEW + :ivar default_config: The default configuration for built-in tools. If omitted, built-in tools + are enabled by default. + :vartype default_config: ~azure.ai.projects.models.MicrosoftCopilotToolsetDefaultConfig + :ivar configs: Per-tool configuration overrides. Duplicate built-in tool names are not allowed. + :vartype configs: list[~azure.ai.projects.models.MicrosoftCopilotToolsetConfig] """ - type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING.""" + type: Literal[ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the toolset. Always ``microsoft_copilot_toolset_preview``. Required. + MICROSOFT_COPILOT_TOOLSET_PREVIEW.""" + default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The default configuration for built-in tools. If omitted, built-in tools are enabled by + default.""" + configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Per-tool configuration overrides. Duplicate built-in tool names are not allowed.""" @overload def __init__( self, + *, + default_config: Optional["_models.MicrosoftCopilotToolsetDefaultConfig"] = None, + configs: Optional[list["_models.MicrosoftCopilotToolsetConfig"]] = None, ) -> None: ... @overload @@ -19725,113 +19963,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.PROGRAMMATIC_TOOL_CALLING # type: ignore + self.type = ToolType.MICROSOFT_COPILOT_TOOLSET_PREVIEW # type: ignore -class PromptAgentDefinition( - AgentDefinition, discriminator="prompt" +class MicrosoftFabricPreviewTool( + Tool, discriminator="fabric_dataagent_preview" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The prompt agent definition. + """The input definition information for a Microsoft Fabric tool as used to configure an agent. - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. PROMPT. - :vartype kind: str or ~azure.ai.projects.models.PROMPT - :ivar harness: The managed runtime and agent loop used to execute this prompt agent. - :vartype harness: ~azure.ai.projects.models.AgentHarness - :ivar model: The model deployment to use for this agent. Required. - :vartype model: str - :ivar instructions: A system (or developer) message inserted into the model's context. - :vartype instructions: str - :ivar skills: The Foundry skills available to this prompt agent. An omitted skill version is - resolved and pinned when the agent version is created. - :vartype skills: list[~azure.ai.projects.models.SkillReference] - :ivar temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 - will make the output more random, while lower values like 0.2 will make it more focused and - deterministic. We generally recommend altering this or ``top_p`` but not both. Defaults to - ``1``. - :vartype temperature: float - :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, where the - model considers the results of the tokens with top_p probability mass. So 0.1 means only the - tokens comprising the top 10% probability mass are considered. We generally recommend altering - this or ``temperature`` but not both. Defaults to ``1``. - :vartype top_p: float - :ivar reasoning: - :vartype reasoning: ~azure.ai.projects.models.Reasoning - :ivar tools: An array of tools the model may call while generating a response. You can specify - which tool to use by setting the ``tool_choice`` parameter. - :vartype tools: list[~azure.ai.projects.models.Tool] - :ivar tool_choice: How the model should select which tool (or tools) to use when generating a - response. See the ``tools`` parameter to see how to specify which tools the model can call. Is - either a str type or a ToolChoiceParam type. - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceParam - :ivar text: Configuration options for a text response from the model. Can be plain text or - structured JSON data. - :vartype text: ~azure.ai.projects.models.PromptAgentDefinitionTextOptions - :ivar structured_inputs: Set of structured inputs that can participate in prompt template - substitution or tool argument bindings. - :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.FABRIC_DATAAGENT_PREVIEW + :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. + :vartype fabric_dataagent_preview: ~azure.ai.projects.models.FabricDataAgentToolParameters """ - kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. PROMPT.""" - harness: Optional["_models.AgentHarness"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The managed runtime and agent loop used to execute this prompt agent.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model deployment to use for this agent. Required.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A system (or developer) message inserted into the model's context.""" - skills: Optional[list["_models.SkillReference"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Foundry skills available to this prompt agent. An omitted skill version is resolved and - pinned when the agent version is created.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output - more random, while lower values like 0.2 will make it more focused and deterministic. We - generally recommend altering this or ``top_p`` but not both. Defaults to ``1``.""" - top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An alternative to sampling with temperature, called nucleus sampling, where the model considers - the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising - the top 10% probability mass are considered. We generally recommend altering this or - ``temperature`` but not both. Defaults to ``1``.""" - reasoning: Optional["_models.Reasoning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An array of tools the model may call while generating a response. You can specify which tool to - use by setting the ``tool_choice`` parameter.""" - tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the model should select which tool (or tools) to use when generating a response. See the - ``tools`` parameter to see how to specify which tools the model can call. Is either a str type - or a ToolChoiceParam type.""" - text: Optional["_models.PromptAgentDefinitionTextOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration options for a text response from the model. Can be plain text or structured JSON - data.""" - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW.""" + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Set of structured inputs that can participate in prompt template substitution or tool argument - bindings.""" + """The fabric data agent tool parameters. Required.""" @overload def __init__( self, *, - model: str, - rai_config: Optional["_models.RaiConfig"] = None, - harness: Optional["_models.AgentHarness"] = None, - instructions: Optional[str] = None, - skills: Optional[list["_models.SkillReference"]] = None, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - reasoning: Optional["_models.Reasoning"] = None, - tools: Optional[list["_models.Tool"]] = None, - tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = None, - text: Optional["_models.PromptAgentDefinitionTextOptions"] = None, - structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", ) -> None: ... @overload @@ -19843,26 +20002,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.PROMPT # type: ignore + self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore -class PromptAgentDefinitionTextOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration options for a text response from the model. Can be plain text or structured JSON - data. +class MisalignmentErrorDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MisalignmentErrorDetailsResource. - :ivar format: - :vartype format: ~azure.ai.projects.models.TextResponseFormat + :ivar review_target: + :vartype review_target: str + :ivar error_type: An optional classification; clients must accept additional values. Known + values are: "potentially_unintended_data_transfer", "potentially_unintended_data_access", + "potentially_unintended_destructive_activity", and "other". + :vartype error_type: str or ~azure.ai.projects.models.MisalignmentErrorType + :ivar detailed_explanation: The public explanation for this block. + :vartype detailed_explanation: str + :ivar steer: An optional public continuation instruction. + :vartype steer: ~azure.ai.projects.models.MisalignmentSteer """ - format: Optional["_models.TextResponseFormat"] = rest_field( + review_target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional classification; clients must accept additional values. Known values are: + \"potentially_unintended_data_transfer\", \"potentially_unintended_data_access\", + \"potentially_unintended_destructive_activity\", and \"other\".""" + detailed_explanation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The public explanation for this block.""" + steer: Optional["_models.MisalignmentSteer"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """An optional public continuation instruction.""" @overload def __init__( self, *, - format: Optional["_models.TextResponseFormat"] = None, + review_target: Optional[str] = None, + error_type: Optional[Union[str, "_models.MisalignmentErrorType"]] = None, + detailed_explanation: Optional[str] = None, + steer: Optional["_models.MisalignmentSteer"] = None, ) -> None: ... @overload @@ -19876,38 +20055,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PromptBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="prompt" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt-based evaluator. +class MisalignmentSteer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """MisalignmentSteer. - :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. - This includes parameters like type, properties, required. - :vartype init_parameters: dict[str, any] - :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This - includes parameters like type, properties, required. - :vartype data_schema: dict[str, any] - :ivar metrics: List of output metrics produced by this evaluator. - :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] - :ivar type: Required. Prompt-based definition. - :vartype type: str or ~azure.ai.projects.models.PROMPT - :ivar prompt_text: The prompt text used for evaluation. Required. - :vartype prompt_text: str + :ivar message: The public continuation instruction. Required. + :vartype message: str """ - type: Literal[EvaluatorDefinitionType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Prompt-based definition.""" - prompt_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The prompt text used for evaluation. Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The public continuation instruction. Required.""" @overload def __init__( self, *, - prompt_text: str, - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + message: str, ) -> None: ... @overload @@ -19919,38 +20081,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.PROMPT # type: ignore -class PromptDataGenerationJobSource( - DataGenerationJobSource, discriminator="prompt" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt source for data generation jobs — inline text provided by the user. +class ModelCredentialRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request to fetch credentials for a model asset. - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline - text provided by the user. - :vartype type: str or ~azure.ai.projects.models.PROMPT - :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). - Required. - :vartype prompt: str + :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: str """ - type: Literal[DataGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Prompt. Required. Prompt source — inline text - provided by the user.""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """Blob URI of the model asset to fetch credentials for. Required.""" @overload def __init__( self, *, - prompt: str, - description: Optional[str] = None, + blob_uri: str, ) -> None: ... @overload @@ -19962,41 +20109,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobSourceType.PROMPT # type: ignore -class PromptEvaluatorGenerationJobSource( - EvaluatorGenerationJobSource, discriminator="prompt" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Prompt source for evaluator generation jobs — inline text provided by the user. - - :ivar description: Optional description of what this source represents — helps the pipeline - interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core - capabilities'). - :vartype description: str - :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline - text provided by the user. - :vartype type: str or ~azure.ai.projects.models.PROMPT - :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). - Required. - :vartype prompt: str - """ +class ModelDeployment(Deployment, discriminator="ModelDeployment"): + """Model Deployment Definition. - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional description of what this source represents — helps the pipeline interpret its content - (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" - type: Literal[EvaluatorGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The source type for this source, which is Prompt. Required. Prompt source — inline text - provided by the user.""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + :ivar name: Name of the deployment. Required. + :vartype name: str + :ivar type: The type of the deployment. Required. Model deployment. + :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT + :ivar model_name: Publisher-specific name of the deployed model. Required. + :vartype model_name: str + :ivar model_version: Publisher-specific version of the deployed model. Required. + :vartype model_version: str + :ivar model_publisher: Name of the deployed model's publisher. Required. + :vartype model_publisher: str + :ivar capabilities: Capabilities of deployed model. Required. + :vartype capabilities: dict[str, str] + :ivar sku: Sku of the model deployment. Required. + :vartype sku: ~azure.ai.projects.models.ModelDeploymentSku + :ivar connection_name: Name of the connection the deployment comes from. + :vartype connection_name: str + """ + + type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the deployment. Required. Model deployment.""" + model_name: str = rest_field(name="modelName", visibility=["read"]) + """Publisher-specific name of the deployed model. Required.""" + model_version: str = rest_field(name="modelVersion", visibility=["read"]) + """Publisher-specific version of the deployed model. Required.""" + model_publisher: str = rest_field(name="modelPublisher", visibility=["read"]) + """Name of the deployed model's publisher. Required.""" + capabilities: dict[str, str] = rest_field(visibility=["read"]) + """Capabilities of deployed model. Required.""" + sku: "_models.ModelDeploymentSku" = rest_field(visibility=["read"]) + """Sku of the model deployment. Required.""" + connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"]) + """Name of the connection the deployment comes from.""" @overload def __init__( self, - *, - prompt: str, - description: Optional[str] = None, ) -> None: ... @overload @@ -20008,32 +20161,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorGenerationJobSourceType.PROMPT # type: ignore + self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore -class PromptOptimizationConfiguration( - AgentOptimizationConfigurationBase, discriminator="prompt_optimization" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for a one-shot prompt transformation without comparative evaluation. +class ModelDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Sku information. - :ivar type: Optimization type discriminator. Required. One-shot prompt optimization. - :vartype type: str or ~azure.ai.projects.models.PROMPT_OPTIMIZATION - :ivar context: Context used to steer prompt optimization. Omitted when no context is supplied. - :vartype context: list[~azure.ai.projects.models.OptimizationContext] + :ivar capacity: Sku capacity. Required. + :vartype capacity: int + :ivar family: Sku family. Required. + :vartype family: str + :ivar name: Sku name. Required. + :vartype name: str + :ivar size: Sku size. Required. + :vartype size: str + :ivar tier: Sku tier. Required. + :vartype tier: str """ - type: Literal[AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Optimization type discriminator. Required. One-shot prompt optimization.""" - context: Optional[list["_models.OptimizationContext"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Context used to steer prompt optimization. Omitted when no context is supplied.""" + capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku capacity. Required.""" + family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku family. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku name. Required.""" + size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku size. Required.""" + tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku tier. Required.""" @overload def __init__( self, *, - context: Optional[list["_models.OptimizationContext"]] = None, + capacity: int, + family: str, + name: str, + size: str, + tier: str, ) -> None: ... @overload @@ -20045,61 +20210,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION # type: ignore -class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-protocol configuration for the agent endpoint. +class ModelPendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload of a model version. - :ivar activity: Configuration for the activity protocol. - :vartype activity: ~azure.ai.projects.models.ActivityProtocolConfiguration - :ivar responses: Configuration for the responses protocol. - :vartype responses: ~azure.ai.projects.models.ResponsesProtocolConfiguration - :ivar a2a: Configuration for the A2A protocol. - :vartype a2a: ~azure.ai.projects.models.A2AProtocolConfiguration - :ivar mcp: Configuration for the MCP protocol. - :vartype mcp: ~azure.ai.projects.models.McpProtocolConfiguration - :ivar invocations: Configuration for the invocations protocol. - :vartype invocations: ~azure.ai.projects.models.InvocationsProtocolConfiguration - :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. - :vartype invocations_ws: ~azure.ai.projects.models.InvocationsWsProtocolConfiguration + :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. + :vartype pending_upload_id: str + :ivar connection_name: Azure Storage Account connection name to use for generating temporary + SAS token. + :vartype connection_name: str + :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported + for models. Required. Temporary blob reference. + :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE """ - activity: Optional["_models.ActivityProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the activity protocol.""" - responses: Optional["_models.ResponsesProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the responses protocol.""" - a2a: Optional["_models.A2AProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for the A2A protocol.""" - mcp: Optional["_models.McpProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + pending_upload_id: Optional[str] = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for the MCP protocol.""" - invocations: Optional["_models.InvocationsProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """If PendingUploadId is not provided, a random GUID will be used.""" + connection_name: Optional[str] = rest_field( + name="connectionName", visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for the invocations protocol.""" - invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for the WebSocket-based invocations protocol.""" + """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. + Temporary blob reference.""" @overload def __init__( self, *, - activity: Optional["_models.ActivityProtocolConfiguration"] = None, - responses: Optional["_models.ResponsesProtocolConfiguration"] = None, - a2a: Optional["_models.A2AProtocolConfiguration"] = None, - mcp: Optional["_models.McpProtocolConfiguration"] = None, - invocations: Optional["_models.InvocationsProtocolConfiguration"] = None, - invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = None, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -20113,30 +20259,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A record mapping for a single protocol and its version. +class ModelPendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a model pending upload request. - :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", - "mcp", "invocations", "voice", and "invocations_ws". - :vartype protocol: str or ~azure.ai.projects.models.AgentEndpointProtocol - :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. + :ivar blob_reference: Container-level read, write, list SAS. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar pending_upload_id: ID for this upload request. Required. + :vartype pending_upload_id: str + :ivar version: Version of asset to be created if user did not specify version when initially + creating upload. :vartype version: str + :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported + for models. Required. Temporary blob reference. + :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE """ - protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] ) - """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", - \"invocations\", \"voice\", and \"invocations_ws\".""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version string for the protocol, e.g. 'v0.1.1'. Required.""" + """Container-level read, write, list SAS. Required.""" + pending_upload_id: str = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """ID for this upload request. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of asset to be created if user did not specify version when initially creating upload.""" + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. + Temporary blob reference.""" @overload def __init__( self, *, - protocol: Union[str, "_models.AgentEndpointProtocol"], - version: str, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -20150,28 +20311,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyTransferDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A destination for a telephony transfer target. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - PSTNTelephonyTransferDestination, SipTelephonyTransferDestination, - TeamsTelephonyTransferDestination +class ModelSamplingParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a set of parameters used to control the sampling behavior of a language model during + text generation. - :ivar kind: The telephony transfer destination type. Required. Known values are: "pstn", - "teams", and "sip". - :vartype kind: str or ~azure.ai.projects.models.TelephonyTransferDestinationKind + :ivar temperature: The temperature parameter for sampling. Defaults to 1.0. + :vartype temperature: float + :ivar top_p: The top-p parameter for nucleus sampling. Defaults to 1.0. + :vartype top_p: float + :ivar seed: The random seed for reproducibility. Defaults to 42. + :vartype seed: int + :ivar max_completion_tokens: The maximum number of tokens allowed in the completion. + :vartype max_completion_tokens: int """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The telephony transfer destination type. Required. Known values are: \"pstn\", \"teams\", and - \"sip\".""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The temperature parameter for sampling. Defaults to 1.0.""" + top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The top-p parameter for nucleus sampling. Defaults to 1.0.""" + seed: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The random seed for reproducibility. Defaults to 42.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of tokens allowed in the completion.""" @overload def __init__( self, *, - kind: str, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + seed: Optional[int] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -20185,28 +20355,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PSTNTelephonyTransferDestination( - TelephonyTransferDestination, discriminator="pstn" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A PSTN destination for a telephony transfer target. +class ModelSourceData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Source information for the model. - :ivar kind: The PSTN destination type. Required. A public switched telephone network - destination. - :vartype kind: str or ~azure.ai.projects.models.PSTN - :ivar value: The E.164 phone number to call. Required. - :vartype value: str + :ivar source_type: The source type of the model. Known values are: "LocalUpload" and + "TrainingJob". + :vartype source_type: str or ~azure.ai.projects.models.FoundryModelSourceType + :ivar job_id: The job ID that produced this model. + :vartype job_id: str """ - kind: Literal[TelephonyTransferDestinationKind.PSTN] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The PSTN destination type. Required. A public switched telephone network destination.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The E.164 phone number to call. Required.""" + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = rest_field( + name="sourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" + job_id: Optional[str] = rest_field(name="jobId", visibility=["read", "create", "update", "delete", "query"]) + """The job ID that produced this model.""" @overload def __init__( self, *, - value: str, + source_type: Optional[Union[str, "_models.FoundryModelSourceType"]] = None, + job_id: Optional[str] = None, ) -> None: ... @overload @@ -20218,37 +20389,80 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelephonyTransferDestinationKind.PSTN # type: ignore -class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for Responsible AI (RAI) content filtering and safety features. +class ModelVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Version Definition. - :ivar rai_policy_name: The name of the RAI policy to apply. Required. - :vartype rai_policy_name: str - :ivar invocations_moderation: Author-declared configuration telling the platform where - user/agent text lives in the agent-defined invocations request/response bodies, so - content-safety guardrails can extract and moderate it. Optional; a rai_config without it leaves - the invocations path without content-safety moderation. - :vartype invocations_moderation: ~azure.ai.projects.models.RaiInvocationModeration + :ivar blob_uri: URI of the model artifact in blob storage. Required. + :vartype blob_uri: str + :ivar weight_type: The weight type of the model. Known values are: "FullWeight", "LoRA", and + "DraftModel". + :vartype weight_type: str or ~azure.ai.projects.models.FoundryModelWeightType + :ivar base_model: Base model asset ID. + :vartype base_model: str + :ivar source: The source of the model. + :vartype source: ~azure.ai.projects.models.ModelSourceData + :ivar lora_config: Adapter-specific configuration. Required when weight_type is lora; ignored + otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — + user-provided values take precedence over auto-detected values. + :vartype lora_config: ~azure.ai.projects.models.LoraConfig + :ivar artifact_profile: The artifact profile of the model. + :vartype artifact_profile: ~azure.ai.projects.models.ArtifactProfile + :ivar warnings: Service-computed advisory warnings derived from the artifact profile. + :vartype warnings: list[~azure.ai.projects.models.FoundryModelWarning] + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] """ - rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the RAI policy to apply. Required.""" - invocations_moderation: Optional["_models.RaiInvocationModeration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """URI of the model artifact in blob storage. Required.""" + weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = rest_field( + name="weightType", visibility=["read", "create", "update", "delete", "query"] ) - """Author-declared configuration telling the platform where user/agent text lives in the - agent-defined invocations request/response bodies, so content-safety guardrails can extract and - moderate it. Optional; a rai_config without it leaves the invocations path without - content-safety moderation.""" + """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" + base_model: Optional[str] = rest_field(name="baseModel", visibility=["read", "create"]) + """Base model asset ID.""" + source: Optional["_models.ModelSourceData"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source of the model.""" + lora_config: Optional["_models.LoraConfig"] = rest_field(name="loraConfig", visibility=["read", "create"]) + """Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be + auto-populated from adapter_config.json when present in the uploaded files — user-provided + values take precedence over auto-detected values.""" + artifact_profile: Optional["_models.ArtifactProfile"] = rest_field(name="artifactProfile", visibility=["read"]) + """The artifact profile of the model.""" + warnings: Optional[list["_models.FoundryModelWarning"]] = rest_field(visibility=["read"]) + """Service-computed advisory warnings derived from the artifact profile.""" + id: Optional[str] = rest_field(visibility=["read"]) + """Asset ID, a unique identifier for the asset.""" + name: str = rest_field(visibility=["read"]) + """The name of the resource. Required.""" + version: str = rest_field(visibility=["read"]) + """The version of the resource. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, - rai_policy_name: str, - invocations_moderation: Optional["_models.RaiInvocationModeration"] = None, + blob_uri: str, + weight_type: Optional[Union[str, "_models.FoundryModelWeightType"]] = None, + base_model: Optional[str] = None, + source: Optional["_models.ModelSourceData"] = None, + lora_config: Optional["_models.LoraConfig"] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -20262,65 +20476,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiInvocationModeration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Declares where request/response text lives so content-safety guardrails can extract it. +class MonthlyRecurrenceSchedule( + RecurrenceSchedule, discriminator="Monthly" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Monthly recurrence schedule. - :ivar input_content_type: How the REQUEST body is parsed. When omitted, the service defaults to - ``json``. Known values are: "json" and "text". - :vartype input_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType - :ivar output_content_type: How the RESPONSE body is parsed. When omitted, the service defaults - to ``json``. Known values are: "json" and "text". - :vartype output_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType - :ivar response_mode: Author-declared response shape; drives which output gate runs and which - fields are required. Required. Known values are: "non_streaming", "streaming", and "both". - :vartype response_mode: str or ~azure.ai.projects.models.RaiInvocationMode - :ivar input_paths: Path(s) to user text in the REQUEST body. Required when input_content_type - is ``json``. - :vartype input_paths: list[str] - :ivar output_paths: Path(s) to agent text in a NON-STREAMING response body. Required when - response_mode is non_streaming/both and output_content_type is ``json``. - :vartype output_paths: list[str] - :ivar stream_selectors: One SSE event->field selector per event type carrying text. Required - when response_mode is streaming/both and output_content_type is ``json``. - :vartype stream_selectors: list[~azure.ai.projects.models.RaiSseTextSelector] + :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.MONTHLY + :ivar days_of_month: Days of the month for the recurrence schedule. Required. + :vartype days_of_month: list[int] """ - input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the REQUEST body is parsed. When omitted, the service defaults to ``json``. Known values - are: \"json\" and \"text\".""" - output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the RESPONSE body is parsed. When omitted, the service defaults to ``json``. Known values - are: \"json\" and \"text\".""" - response_mode: Union[str, "_models.RaiInvocationMode"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Author-declared response shape; drives which output gate runs and which fields are required. - Required. Known values are: \"non_streaming\", \"streaming\", and \"both\".""" - input_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Path(s) to user text in the REQUEST body. Required when input_content_type is ``json``.""" - output_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Path(s) to agent text in a NON-STREAMING response body. Required when response_mode is - non_streaming/both and output_content_type is ``json``.""" - stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[RecurrenceType.MONTHLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Monthly recurrence type. Required. Monthly recurrence pattern.""" + days_of_month: list[int] = rest_field( + name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] ) - """One SSE event->field selector per event type carrying text. Required when response_mode is - streaming/both and output_content_type is ``json``.""" + """Days of the month for the recurrence schedule. Required.""" @overload def __init__( self, *, - response_mode: Union[str, "_models.RaiInvocationMode"], - input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, - output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, - input_paths: Optional[list[str]] = None, - output_paths: Optional[list[str]] = None, - stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = None, + days_of_month: list[int], ) -> None: ... @overload @@ -20332,30 +20510,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RecurrenceType.MONTHLY # type: ignore -class RaiSseTextSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An SSE event-type to text-field selector for streaming invocation output. +class NamespaceToolParam( + Tool, discriminator="namespace" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Namespace. - :ivar event_type: The SSE event ``type`` value that carries text. Required. - :vartype event_type: str - :ivar text_field: The field on a matched event holding the text delta. When omitted, the - service defaults to ``delta``. - :vartype text_field: str + :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. + :vartype type: str or ~azure.ai.projects.models.NAMESPACE + :ivar name: The namespace name used in tool calls (for example, ``crm``). Required. + :vartype name: str + :ivar description: A description of the namespace shown to the model. Required. + :vartype description: str + :ivar tools: The function/custom tools available inside this namespace. Required. + :vartype tools: list[~azure.ai.projects.models.FunctionToolParam or + ~azure.ai.projects.models.CustomToolParam] """ - event_type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SSE event ``type`` value that carries text. Required.""" - text_field: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The field on a matched event holding the text delta. When omitted, the service defaults to - ``delta``.""" + type: Literal[ToolType.NAMESPACE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace name used in tool calls (for example, ``crm``). Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the namespace shown to the model. Required.""" + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The function/custom tools available inside this namespace. Required.""" @overload def __init__( self, *, - event_type: str, - text_field: Optional[str] = None, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], ) -> None: ... @overload @@ -20367,43 +20558,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.NAMESPACE # type: ignore -class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RankingOptions. +class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): + """Credentials that do not require authentication. - :ivar ranker: The ranker to use for the file search. Known values are: "auto" and - "default-2024-11-15". - :vartype ranker: str or ~azure.ai.projects.models.RankerVersionType - :ivar score_threshold: The score threshold for the file search, a number between 0 and 1. - Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer - results. - :vartype score_threshold: float - :ivar hybrid_search: Weights that control how reciprocal rank fusion balances semantic - embedding matches versus sparse keyword matches when hybrid search is enabled. - :vartype hybrid_search: ~azure.ai.projects.models.HybridSearchOptions + :ivar type: The credential type. Required. No credential. + :vartype type: str or ~azure.ai.projects.models.NONE """ - ranker: Optional[Union[str, "_models.RankerVersionType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" - score_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will - attempt to return only the most relevant results, but may return fewer results.""" - hybrid_search: Optional["_models.HybridSearchOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Weights that control how reciprocal rank fusion balances semantic embedding matches versus - sparse keyword matches when hybrid search is enabled.""" + type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. No credential.""" @overload def __init__( self, - *, - ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, - score_threshold: Optional[float] = None, - hybrid_search: Optional["_models.HybridSearchOptions"] = None, ) -> None: ... @overload @@ -20415,27 +20585,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.NONE # type: ignore -class RealtimeAudioFormats(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeAudioFormats. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu +class OneTimeTrigger(Trigger, discriminator="OneTime"): # pylint: disable=docstring-keyword-should-match-keyword-only + """One-time trigger. - :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". - :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType + :ivar type: Required. One-time trigger. + :vartype type: str or ~azure.ai.projects.models.ONE_TIME + :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. + :vartype trigger_at: ~datetime.datetime + :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. + :vartype time_zone: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" + type: Literal[TriggerType.ONE_TIME] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. One-time trigger.""" + trigger_at: datetime.datetime = rest_field( + name="triggerAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Date and time for the one-time trigger in ISO 8601 format. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the one-time trigger. Defaults to ``UTC``.""" @overload def __init__( self, *, - type: str, + trigger_at: datetime.datetime, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -20447,29 +20625,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TriggerType.ONE_TIME # type: ignore -class RealtimeAudioFormatsAudioPcm( - RealtimeAudioFormats, discriminator="audio/pcm" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeAudioFormatsAudioPcm. +class OpenApiAuthDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """authentication details for OpenApiFunctionDefinition. - :ivar type: Required. AUDIO_PCM. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM - :ivar rate: Default value is 24000. - :vartype rate: int + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails + + :ivar type: The type of authentication, must be anonymous/project_connection/managed_identity. + Required. Known values are: "anonymous", "project_connection", and "managed_identity". + :vartype type: str or ~azure.ai.projects.models.OpenApiAuthType """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCM.""" - rate: Optional[Literal[24000]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is 24000.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of authentication, must be anonymous/project_connection/managed_identity. Required. + Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" @overload def __init__( self, *, - rate: Optional[Literal[24000]] = None, + type: str, ) -> None: ... @overload @@ -20481,18 +20660,17 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore -class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): - """RealtimeAudioFormatsAudioPcma. +class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): + """Security details for OpenApi anonymous authentication. - :ivar type: Required. AUDIO_PCMA. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: str or ~azure.ai.projects.models.ANONYMOUS """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMA.""" + type: Literal[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" @overload def __init__( @@ -20508,22 +20686,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore + self.type = OpenApiAuthType.ANONYMOUS # type: ignore -class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): - """RealtimeAudioFormatsAudioPcmu. +class OpenApiFunctionDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an openapi function. - :ivar type: Required. AUDIO_PCMU. - :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar spec: The openapi function shape, described as a JSON Schema object. Required. + :vartype spec: dict[str, any] + :ivar auth: Open API authentication details. Required. + :vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails + :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. + :vartype default_params: list[str] + :ivar functions: List of function definitions used by OpenApi tool. + :vartype functions: list[~azure.ai.projects.models.OpenApiFunctionDefinitionFunction] """ - type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO_PCMU.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + spec: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The openapi function shape, described as a JSON Schema object. Required.""" + auth: "_models.OpenApiAuthDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Open API authentication details. Required.""" + default_params: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of OpenAPI spec parameters that will use user-provided defaults.""" + functions: Optional[list["_models.OpenApiFunctionDefinitionFunction"]] = rest_field(visibility=["read"]) + """List of function definitions used by OpenApi tool.""" @overload def __init__( self, + *, + name: str, + spec: dict[str, Any], + auth: "_models.OpenApiAuthDetails", + description: Optional[str] = None, + default_params: Optional[list[str]] = None, ) -> None: ... @overload @@ -20535,41 +20741,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore - -class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime client event. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeClientEventConversationItemCreate, RealtimeClientEventConversationItemDelete, - RealtimeClientEventConversationItemRetrieve, RealtimeClientEventConversationItemTruncate, - RealtimeClientEventInputAudioBufferAppend, RealtimeClientEventInputAudioBufferClear, - RealtimeClientEventInputAudioBufferCommit, RealtimeClientEventOutputAudioBufferClear, - RealtimeClientEventResponseCancel, RealtimeClientEventResponseCreate, - VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect +class OpenApiFunctionDefinitionFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OpenApiFunctionDefinitionFunction. - :ivar type: Required. Known values are: "conversation.item.create", "conversation.item.delete", - "conversation.item.retrieve", "conversation.item.truncate", "input_audio_buffer.append", - "input_audio_buffer.clear", "output_audio_buffer.clear", "input_audio_buffer.commit", - "response.cancel", "response.create", "session.update", "session.avatar.connect", and - "rtc.call.sdp.create". - :vartype type: str or ~azure.ai.projects.models.RealtimeClientEventType + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. + Required. + :vartype parameters: dict[str, any] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"conversation.item.create\", \"conversation.item.delete\", - \"conversation.item.retrieve\", \"conversation.item.truncate\", \"input_audio_buffer.append\", - \"input_audio_buffer.clear\", \"output_audio_buffer.clear\", \"input_audio_buffer.commit\", - \"response.cancel\", \"response.create\", \"session.update\", \"session.avatar.connect\", and - \"rtc.call.sdp.create\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameters the functions accepts, described as a JSON Schema object. Required.""" @overload def __init__( self, *, - type: str, + name: str, + parameters: dict[str, Any], + description: Optional[str] = None, ) -> None: ... @overload @@ -20583,51 +20784,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeClientEventConversationItemCreate( - RealtimeClientEvent, discriminator="conversation.item.create" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Add a new Item to the Conversation's context, including messages, function calls, and function - call responses. This event can be used both to populate a "history" of the conversation and to - add new items mid-stream, but has the current limitation that it cannot populate assistant - audio messages. If successful, the server will emit a ``conversation.item.added`` event and, - when the item is finalized, a ``conversation.item.done`` event. Otherwise, an ``error`` event - will be sent. +class OpenApiManagedAuthDetails( + OpenApiAuthDetails, discriminator="managed_identity" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security details for OpenApi managed_identity authentication. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.create``. Required. - CONVERSATION_ITEM_CREATE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATE - :ivar previous_item_id: The ID of the preceding item after which the new item will be inserted. - If not set, the new item will be appended to the end of the conversation. If set to ``root``, - the new item will be added to the beginning of the conversation. If set to an existing ID, it - allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be - returned and the item will not be added. - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. + :vartype type: str or ~azure.ai.projects.models.MANAGED_IDENTITY + :ivar security_scheme: Connection auth security details. Required. + :vartype security_scheme: ~azure.ai.projects.models.OpenApiManagedSecurityScheme """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the preceding item after which the new item will be inserted. If not set, the new - item will be appended to the end of the conversation. If set to ``root``, the new item will be - added to the beginning of the conversation. If set to an existing ID, it allows an item to be - inserted mid-conversation. If the ID cannot be found, an error will be returned and the item - will not be added.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" + security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Connection auth security details. Required.""" @overload def __init__( self, *, - item: "_models.RealtimeConversationItem", - event_id: Optional[str] = None, - previous_item_id: Optional[str] = None, + security_scheme: "_models.OpenApiManagedSecurityScheme", ) -> None: ... @overload @@ -20639,38 +20818,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_CREATE # type: ignore + self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore -class RealtimeClientEventConversationItemDelete( - RealtimeClientEvent, discriminator="conversation.item.delete" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event when you want to remove any item from the conversation history. The server will - respond with a ``conversation.item.deleted`` event, unless the item does not exist in the - conversation history, in which case the server will respond with an error. +class OpenApiManagedSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.delete``. Required. - CONVERSATION_ITEM_DELETE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETE - :ivar item_id: The ID of the item to delete. Required. - :vartype item_id: str + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to delete. Required.""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication scope for managed_identity auth type. Required.""" @overload def __init__( self, *, - item_id: str, - event_id: Optional[str] = None, + audience: str, ) -> None: ... @overload @@ -20682,40 +20847,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_DELETE # type: ignore -class RealtimeClientEventConversationItemRetrieve( - RealtimeClientEvent, discriminator="conversation.item.retrieve" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event when you want to retrieve the server's representation of a specific item in the - conversation history. This is useful, for example, to inspect user audio after noise - cancellation and VAD. The server will respond with a ``conversation.item.retrieved`` event, - unless the item does not exist in the conversation history, in which case the server will - respond with an error. +class OpenApiProjectConnectionAuthDetails( + OpenApiAuthDetails, discriminator="project_connection" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security details for OpenApi project connection authentication. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.retrieve``. Required. - CONVERSATION_ITEM_RETRIEVE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVE - :ivar item_id: The ID of the item to retrieve. Required. - :vartype item_id: str + :ivar type: The object type, which is always 'project_connection'. Required. + PROJECT_CONNECTION. + :vartype type: str or ~azure.ai.projects.models.PROJECT_CONNECTION + :ivar security_scheme: Project connection auth security details. Required. + :vartype security_scheme: ~azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to retrieve. Required.""" + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Project connection auth security details. Required.""" @overload def __init__( self, *, - item_id: str, - event_id: Optional[str] = None, + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", ) -> None: ... @overload @@ -20727,57 +20884,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE # type: ignore + self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class RealtimeClientEventConversationItemTruncate( - RealtimeClientEvent, discriminator="conversation.item.truncate" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event to truncate a previous assistant message’s audio. The server will produce audio - faster than realtime, so this event is useful when the user interrupts to truncate audio that - has already been sent to the client but not yet played. This will synchronize the server's - understanding of the audio with the client's playback. Truncating audio will delete the - server-side text transcript to ensure there is not text in the context that hasn't been heard - by the user. If successful, the server will respond with a ``conversation.item.truncated`` - event. +class OpenApiProjectConnectionSecurityScheme(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Security scheme for OpenApi managed_identity authentication. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.truncate``. Required. - CONVERSATION_ITEM_TRUNCATE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATE - :ivar item_id: The ID of the assistant message item to truncate. Only assistant message items - can be truncated. Required. - :vartype item_id: str - :ivar content_index: The index of the content part to truncate. Set this to ``0``. Required. - :vartype content_index: int - :ivar audio_end_ms: Inclusive duration up to which audio is truncated, in milliseconds. If the - audio_end_ms is greater than the actual audio duration, the server will respond with an error. - Required. - :vartype audio_end_ms: int + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the assistant message item to truncate. Only assistant message items can be - truncated. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part to truncate. Set this to ``0``. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inclusive duration up to which audio is truncated, in milliseconds. If the audio_end_ms is - greater than the actual audio duration, the server will respond with an error. Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for Project Connection auth type. Required.""" @overload def __init__( self, *, - item_id: str, - content_index: int, - audio_end_ms: int, - event_id: Optional[str] = None, + project_connection_id: str, ) -> None: ... @overload @@ -20789,47 +20913,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE # type: ignore -class RealtimeClientEventInputAudioBufferAppend( - RealtimeClientEvent, discriminator="input_audio_buffer.append" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary - storage you can write to and later commit. A "commit" will create a new user message item in - the conversation history from the buffer content and clear the buffer. Input audio - transcription (if enabled) will be generated when the buffer is committed. If VAD is enabled - the audio buffer is used to detect speech and the server will decide when to commit. When - Server VAD is disabled, you must commit the audio buffer manually. Input audio noise reduction - operates on writes to the audio buffer. The client may choose how much audio to place in each - event up to a maximum of 15 MiB, for example streaming smaller chunks from the client may allow - the VAD to be more responsive. Unlike most other client events, the server will not send a - confirmation response to this event. +class OpenApiTool(Tool, discriminator="openapi"): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for an OpenAPI tool as used to configure an agent. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.append``. Required. - INPUT_AUDIO_BUFFER_APPEND. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_APPEND - :ivar audio: Base64-encoded audio bytes. This must be in the format specified by the - ``input_audio_format`` field in the session configuration. Required. - :vartype audio: str + :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` - field in the session configuration. Required.""" + type: Literal[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'openapi'. Required. OPENAPI.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" + openapi: "_models.OpenApiFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The openapi function definition. Required.""" @overload def __init__( self, *, - audio: str, - event_id: Optional[str] = None, + openapi: "_models.OpenApiFunctionDefinition", + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -20841,32 +20955,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND # type: ignore + self.type = ToolType.OPENAPI # type: ignore -class RealtimeClientEventInputAudioBufferClear( - RealtimeClientEvent, discriminator="input_audio_buffer.clear" +class OpenApiToolboxTool( + ToolboxTool, discriminator="openapi" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Send this event to clear the audio bytes in the buffer. The server will respond with an - ``input_audio_buffer.cleared`` event. + """An OpenAPI tool stored in a toolbox. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.clear``. Required. - INPUT_AUDIO_BUFFER_CLEAR. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEAR + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. OPENAPI. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + type: Literal[ToolboxToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. OPENAPI.""" + openapi: "_models.OpenApiFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The openapi function definition. Required.""" @overload def __init__( self, *, - event_id: Optional[str] = None, + openapi: "_models.OpenApiFunctionDefinition", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -20878,36 +21003,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR # type: ignore + self.type = ToolboxToolType.OPENAPI # type: ignore -class RealtimeClientEventInputAudioBufferCommit( - RealtimeClientEvent, discriminator="input_audio_buffer.commit" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Send this event to commit the user input audio buffer, which will create a new user message - item in the conversation. This event will produce an error if the input audio buffer is empty. - When in Server VAD mode, the client does not need to send this event, the server will commit - the audio buffer automatically. Committing the input audio buffer will trigger input audio - transcription (if enabled in session configuration), but it will not create a response from - the model. The server will respond with an ``input_audio_buffer.committed`` event. +class OptimizationContext(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Base model for typed optimization context. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.commit``. Required. - INPUT_AUDIO_BUFFER_COMMIT. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMIT + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SteeringPromptOptimizationContext + + :ivar type: Optimization context type discriminator. Required. "steering_prompt" + :vartype type: str or ~azure.ai.projects.models.OptimizationContextType """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Optimization context type discriminator. Required. \"steering_prompt\"""" @overload def __init__( self, *, - event_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -20919,35 +21036,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT # type: ignore -class RealtimeClientEventOutputAudioBufferClear( - RealtimeClientEvent, discriminator="output_audio_buffer.clear" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """**WebRTC/SIP Only:** Emit to cut off the current audio response. This will trigger the server - to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be - preceded by a ``response.cancel`` client event to stop the generation of the current response. - `Learn more - `_. +class TelemetryEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telemetry export endpoint configuration. - :ivar event_id: The unique ID of the client event used for error handling. - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.clear``. Required. - OUTPUT_AUDIO_BUFFER_CLEAR. - :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEAR + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OtlpTelemetryEndpoint + + :ivar kind: The telemetry export endpoint kind. Required. "OTLP" + :vartype kind: str or ~azure.ai.projects.models.TelemetryEndpointKind + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + Required. + :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] + :ivar auth: Optional authentication configuration. + :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the client event used for error handling.""" - type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The telemetry export endpoint kind. Required. \"OTLP\"""" + data: list[Union[str, "_models.TelemetryDataKind"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Data types to export to this endpoint. Use an empty array to export no data. Required.""" + auth: Optional["_models.TelemetryEndpointAuth"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional authentication configuration.""" @overload def __init__( self, *, - event_id: Optional[str] = None, + kind: str, + data: list[Union[str, "_models.TelemetryDataKind"]], + auth: Optional["_models.TelemetryEndpointAuth"] = None, ) -> None: ... @overload @@ -20959,42 +21083,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeClientEventResponseCancel( - RealtimeClientEvent, discriminator="response.cancel" +class OtlpTelemetryEndpoint( + TelemetryEndpoint, discriminator="OTLP" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Send this event to cancel an in-progress response. The server will respond with a - ``response.done`` event with a status of ``response.status=cancelled``. If there is no response - to cancel, the server will respond with an error. It's safe to call ``response.cancel`` even if - no response is in progress, an error will be returned the session will remain unaffected. + """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CANCEL - :ivar response_id: A specific response ID to cancel - if not provided, will cancel an - in-progress response in the default conversation. - :vartype response_id: str + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + Required. + :vartype data: list[str or ~azure.ai.projects.models.TelemetryDataKind] + :ivar auth: Optional authentication configuration. + :vartype auth: ~azure.ai.projects.models.TelemetryEndpointAuth + :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. + OpenTelemetry Protocol (OTLP) endpoint. + :vartype kind: str or ~azure.ai.projects.models.OTLP + :ivar endpoint: The OTLP collector endpoint URL. Required. + :vartype endpoint: str + :ivar protocol: The transport protocol for the OTLP endpoint. Required. Known values are: + "Http" and "Grpc". + :vartype protocol: str or ~azure.ai.projects.models.TelemetryTransportProtocol """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A specific response ID to cancel - if not provided, will cancel an in-progress response in the - default conversation.""" - - @overload - def __init__( - self, - *, - event_id: Optional[str] = None, - response_id: Optional[str] = None, - ) -> None: ... - + kind: Literal[TelemetryEndpointKind.OTLP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry + Protocol (OTLP) endpoint.""" + endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OTLP collector endpoint URL. Required.""" + protocol: Union[str, "_models.TelemetryTransportProtocol"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and + \"Grpc\".""" + + @overload + def __init__( + self, + *, + data: list[Union[str, "_models.TelemetryDataKind"]], + endpoint: str, + protocol: Union[str, "_models.TelemetryTransportProtocol"], + auth: Optional["_models.TelemetryEndpointAuth"] = None, + ) -> None: ... + @overload def __init__(self, mapping: Mapping[str, Any]) -> None: """ @@ -21004,50 +21135,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.RESPONSE_CANCEL # type: ignore + self.kind = TelemetryEndpointKind.OTLP # type: ignore -class RealtimeClientEventResponseCreate( - RealtimeClientEvent, discriminator="response.create" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """This event instructs the server to create a Response, which means triggering model inference. - When in Server VAD mode, the server will create Responses automatically. A Response will - include at least one Item, and may have two, in which case the second will be a function call. - These Items will be appended to the conversation history by default. The server will respond - with a ``response.created`` event, events for Items and content created, and finally a - ``response.done`` event to indicate the Response is complete. The ``response.create`` event - includes inference configuration like ``instructions`` and ``tools``. If these are set, they - will override the Session's configuration for this Response only. Responses can be created - out-of-band of the default Conversation, meaning that they can have arbitrary input, and it's - possible to disable writing the output to the Conversation. Only one Response can write to the - default Conversation at a time, but otherwise multiple Responses can be created in parallel. - The ``metadata`` field is a good way to disambiguate multiple simultaneous Responses. Clients - can set ``conversation`` to ``none`` to create a Response that does not write to the default - Conversation. Arbitrary input can be provided with the ``input`` field, which is an array - accepting raw Items and references to existing Items. +class OutputTokensDetailsResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """OutputTokensDetailsResource. - :ivar event_id: Optional client-generated ID used to identify this event. - :vartype event_id: str - :ivar type: The event type, must be ``response.create``. Required. RESPONSE_CREATE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATE - :ivar response: - :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int """ - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional client-generated ID used to identify this event.""" - type: Literal[RealtimeClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - event_id: Optional[str] = None, - response: Optional["_models.VoiceAgentResponseCreateParams"] = None, + reasoning_tokens: int, ) -> None: ... @overload @@ -21059,33 +21164,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeClientEventType.RESPONSE_CREATE # type: ignore -class RealtimeConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single item within a Realtime conversation. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, - RealtimeMCPApprovalRequest, RealtimeMCPApprovalResponse, RealtimeMCPToolCall, - RealtimeMCPListTools, RealtimeConversationItemMessage +class PendingUploadRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a request for a pending upload. - :ivar type: Required. Known values are: "function_call", "function_call_output", - "mcp_approval_response", "mcp_list_tools", "mcp_call", "mcp_approval_request", and "message". - :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType + :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. + :vartype pending_upload_id: str + :ivar connection_name: Azure Storage Account connection name to use for generating temporary + SAS token. + :vartype connection_name: str + :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never + read this value and silently ignored it. Use TemporaryBlobReference instead. + :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function_call\", \"function_call_output\", - \"mcp_approval_response\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and - \"message\".""" + pending_upload_id: Optional[str] = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """If PendingUploadId is not provided, a random GUID will be used.""" + connection_name: Optional[str] = rest_field( + name="connectionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" @overload def __init__( self, *, - type: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + pending_upload_id: Optional[str] = None, + connection_name: Optional[str] = None, ) -> None: ... @overload @@ -21099,69 +21213,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemFunctionCall( - RealtimeConversationItem, discriminator="function_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime function call item. +class PendingUploadResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the response for a pending upload request. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar call_id: The ID of the function call. - :vartype call_id: str - :ivar name: The name of the function being called. Required. - :vartype name: str - :ivar arguments: The arguments of the function call. This is a JSON-encoded string representing - the arguments passed to the function, for example ``{"arg1": "value1", "arg2": 42}``. Required. - :vartype arguments: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar blob_reference: Container-level read, write, list SAS. Required. + :vartype blob_reference: ~azure.ai.projects.models.BlobReference + :ivar pending_upload_id: ID for this upload request. Required. + :vartype pending_upload_id: str + :ivar version: Version of asset to be created if user did not specify version when initially + creating upload. + :vartype version: str + :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never + read this value and silently ignored it. Use TemporaryBlobReference instead. + :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Literal[RealtimeConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + blob_reference: "_models.BlobReference" = rest_field( + name="blobReference", visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function being called. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments of the function call. This is a JSON-encoded string representing the arguments - passed to the function, for example ``{\"arg1\": \"value1\", \"arg2\": 42}``. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """Container-level read, write, list SAS. Required.""" + pending_upload_id: str = rest_field( + name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + ) + """ID for this upload request. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of asset to be created if user did not specify version when initially creating upload.""" + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( + name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" @overload def __init__( self, *, - name: str, - arguments: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, - call_id: Optional[str] = None, + blob_reference: "_models.BlobReference", + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = None, ) -> None: ... @overload @@ -21173,75 +21263,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.FUNCTION_CALL # type: ignore -class RealtimeConversationItemFunctionCallOutput( - RealtimeConversationItem, discriminator="function_call_output" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Realtime function call output item. +class PickPropertiesVoiceAgentAudioConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The template for picking properties. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``function_call_output``. Required. - FUNCTION_CALL_OUTPUT. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar call_id: The ID of the function call this output is for. Required. - :vartype call_id: str - :ivar output: The output of the function call, this is free text and can contain any - information or simply be empty. Required. - :vartype output: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str - :ivar name: The name of the function that was called. A Foundry extension: OpenAI's - function_call_output does not carry the function name, only ``call_id``. - :vartype name: str + :ivar output: Output (agent speech) audio configuration. + :vartype output: ~azure.ai.projects.models.VoiceAgentAudioOutputConfig """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + output: Optional["_models.VoiceAgentAudioOutputConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call this output is for. Required.""" - output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output of the function call, this is free text and can contain any information or simply be - empty. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function that was called. A Foundry extension: OpenAI's function_call_output - does not carry the function name, only ``call_id``.""" + """Output (agent speech) audio configuration.""" @overload def __init__( self, *, - call_id: str, - output: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, - name: Optional[str] = None, + output: Optional["_models.VoiceAgentAudioOutputConfig"] = None, ) -> None: ... @overload @@ -21253,35 +21293,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore -class RealtimeConversationItemMessage( - RealtimeConversationItem, discriminator="message" +class ProceduralMemoryItem( + MemoryItem, discriminator="procedural" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessage. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, - RealtimeConversationItemMessageUser + """A memory item containing a procedure extracted from conversations. - :ivar role: Required. Known values are: "system", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType - :ivar type: Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar memory_id: The unique ID of the memory item. Required. + :vartype memory_id: str + :ivar updated_at: The last update time of the memory item. Required. + :vartype updated_at: ~datetime.datetime + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Routine procedures extracted from + conversations. + :vartype kind: str or ~azure.ai.projects.models.PROCEDURAL """ - __mapping__: dict[str, _Model] = {} - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"system\", \"user\", and \"assistant\".""" - type: Literal[RealtimeConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MESSAGE.""" + kind: Literal[MemoryItemKind.PROCEDURAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. Routine procedures extracted from conversations.""" @overload def __init__( self, *, - role: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -21293,66 +21336,113 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MESSAGE # type: ignore + self.kind = MemoryItemKind.PROCEDURAL # type: ignore -class RealtimeConversationItemMessageAssistant( - RealtimeConversationItemMessage, discriminator="assistant" +class PromptAgentDefinition( + AgentDefinition, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime assistant message item. + """The prompt agent definition. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``message``. Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. - :vartype role: str or ~azure.ai.projects.models.ASSISTANT - :ivar content: The content of the message. Required. - :vartype content: - list[~azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. PROMPT. + :vartype kind: str or ~azure.ai.projects.models.PROMPT + :ivar harness: The managed runtime and agent loop used to execute this prompt agent. + :vartype harness: ~azure.ai.projects.models.AgentHarness + :ivar model: The model deployment to use for this agent. Required. + :vartype model: str + :ivar instructions: A system (or developer) message inserted into the model's context. + :vartype instructions: str + :ivar skills: The Foundry skills available to this prompt agent. An omitted skill version is + resolved and pinned when the agent version is created. + :vartype skills: list[~azure.ai.projects.models.SkillReference] + :ivar temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 + will make the output more random, while lower values like 0.2 will make it more focused and + deterministic. We generally recommend altering this or ``top_p`` but not both. Defaults to + ``1``. + :vartype temperature: float + :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 means only the + tokens comprising the top 10% probability mass are considered. We generally recommend altering + this or ``temperature`` but not both. Defaults to ``1``. + :vartype top_p: float + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.Reasoning + :ivar tools: An array of tools the model may call while generating a response. You can specify + which tool to use by setting the ``tool_choice`` parameter. + :vartype tools: list[~azure.ai.projects.models.Tool] + :ivar tool_choice: How the model should select which tool (or tools) to use when generating a + response. See the ``tools`` parameter to see how to specify which tools the model can call. Is + either a str type or a ToolChoiceParam type. + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceParam + :ivar text: Configuration options for a text response from the model. Can be plain text or + structured JSON data. + :vartype text: ~azure.ai.projects.models.PromptAgentDefinitionTextOptions + :ivar structured_inputs: Set of structured inputs that can participate in prompt template + substitution or tool argument bindings. + :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + kind: Literal[AgentKind.PROMPT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROMPT.""" + harness: Optional["_models.AgentHarness"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The managed runtime and agent loop used to execute this prompt agent.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model deployment to use for this agent. Required.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A system (or developer) message inserted into the model's context.""" + skills: Optional[list["_models.SkillReference"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" - content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + """The Foundry skills available to this prompt agent. An omitted skill version is resolved and + pinned when the agent version is created.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + more random, while lower values like 0.2 will make it more focused and deterministic. We + generally recommend altering this or ``top_p`` but not both. Defaults to ``1``.""" + top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An alternative to sampling with temperature, called nucleus sampling, where the model considers + the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising + the top 10% probability mass are considered. We generally recommend altering this or + ``temperature`` but not both. Defaults to ``1``.""" + reasoning: Optional["_models.Reasoning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An array of tools the model may call while generating a response. You can specify which tool to + use by setting the ``tool_choice`` parameter.""" + tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The content of the message. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """How the model should select which tool (or tools) to use when generating a response. See the + ``tools`` parameter to see how to specify which tools the model can call. Is either a str type + or a ToolChoiceParam type.""" + text: Optional["_models.PromptAgentDefinitionTextOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration options for a text response from the model. Can be plain text or structured JSON + data.""" + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set of structured inputs that can participate in prompt template substitution or tool argument + bindings.""" @overload def __init__( self, *, - type: Literal[RealtimeConversationItemType.MESSAGE], - content: list["_models.RealtimeConversationItemMessageAssistantContent"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + model: str, + rai_config: Optional["_models.RaiConfig"] = None, + harness: Optional["_models.AgentHarness"] = None, + instructions: Optional[str] = None, + skills: Optional[list["_models.SkillReference"]] = None, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + reasoning: Optional["_models.Reasoning"] = None, + tools: Optional[list["_models.Tool"]] = None, + tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = None, + text: Optional["_models.PromptAgentDefinitionTextOptions"] = None, + structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, ) -> None: ... @overload @@ -21364,40 +21454,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + self.kind = AgentKind.PROMPT # type: ignore -class RealtimeConversationItemMessageAssistantContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageAssistantContent. +class PromptAgentDefinitionTextOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration options for a text response from the model. Can be plain text or structured JSON + data. - :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. - :vartype type: str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str + :ivar format: + :vartype format: ~azure.ai.projects.models.TextResponseFormat """ - type: Optional[Literal["output_text", "output_audio"]] = rest_field( + format: Optional["_models.TextResponseFormat"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: Optional[Literal["output_text", "output_audio"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, + format: Optional["_models.TextResponseFormat"] = None, ) -> None: ... @overload @@ -21411,62 +21487,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeConversationItemMessageSystem( - RealtimeConversationItemMessage, discriminator="system" +class PromptBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime system message item. + """Prompt-based evaluator. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``message``. Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. - :vartype role: str or ~azure.ai.projects.models.SYSTEM - :ivar content: The content of the message. Required. - :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystemContent] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] + :ivar type: Required. Prompt-based definition. + :vartype type: str or ~azure.ai.projects.models.PROMPT + :ivar prompt_text: The prompt text used for evaluation. Required. + :vartype prompt_text: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message sender. Always ``system``. Required. SYSTEM.""" - content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content of the message. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + type: Literal[EvaluatorDefinitionType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Prompt-based definition.""" + prompt_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The prompt text used for evaluation. Required.""" @overload def __init__( self, *, - type: Literal[RealtimeConversationItemType.MESSAGE], - content: list["_models.RealtimeConversationItemMessageSystemContent"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + prompt_text: str, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -21478,30 +21530,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = RealtimeConversationItemMessageType.SYSTEM # type: ignore + self.type = EvaluatorDefinitionType.PROMPT # type: ignore -class RealtimeConversationItemMessageSystemContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageSystemContent. +class PromptDataGenerationJobSource( + DataGenerationJobSource, discriminator="prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Prompt source for data generation jobs — inline text provided by the user. - :ivar type: Default value is "input_text". - :vartype type: str - :ivar text: - :vartype text: str + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline + text provided by the user. + :vartype type: str or ~azure.ai.projects.models.PROMPT + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str """ - type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is \"input_text\".""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[DataGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" @overload def __init__( self, *, - type: Optional[Literal["input_text"]] = None, - text: Optional[str] = None, + prompt: str, + description: Optional[str] = None, ) -> None: ... @overload @@ -21513,64 +21573,78 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = DataGenerationJobSourceType.PROMPT # type: ignore -class RealtimeConversationItemMessageUser( - RealtimeConversationItemMessage, discriminator="user" +class PromptEvaluatorGenerationJobSource( + EvaluatorGenerationJobSource, discriminator="prompt" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime user message item. + """Prompt source for evaluator generation jobs — inline text provided by the user. - :ivar id: The unique ID of the item. This may be provided by the client or generated by the - server. - :vartype id: str - :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional - when creating a new item. Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always ``message``. Required. MESSAGE. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of the item. Has no effect on the conversation. Is one of the - following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] - :vartype status: str or str or str - :ivar role: The role of the message sender. Always ``user``. Required. USER. - :vartype role: str or ~azure.ai.projects.models.USER - :ivar content: The content of the message. Required. - :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageUserContent] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline + text provided by the user. + :vartype type: str or ~azure.ai.projects.models.PROMPT + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the item. This may be provided by the client or generated by the server.""" - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the API object being returned - always ``realtime.item``. Optional when creating - a new item. Default value is \"realtime.item\".""" - status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The status of the item. Has no effect on the conversation. Is one of the following types: - Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" - role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message sender. Always ``user``. Required. USER.""" - content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + + @overload + def __init__( + self, + *, + prompt: str, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = EvaluatorGenerationJobSourceType.PROMPT # type: ignore + + +class PromptOptimizationConfiguration( + AgentOptimizationConfigurationBase, discriminator="prompt_optimization" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for a one-shot prompt transformation without comparative evaluation. + + :ivar type: Optimization type discriminator. Required. One-shot prompt optimization. + :vartype type: str or ~azure.ai.projects.models.PROMPT_OPTIMIZATION + :ivar context: Context used to steer prompt optimization. Omitted when no context is supplied. + :vartype context: list[~azure.ai.projects.models.OptimizationContext] + """ + + type: Literal[AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Optimization type discriminator. Required. One-shot prompt optimization.""" + context: Optional[list["_models.OptimizationContext"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The content of the message. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + """Context used to steer prompt optimization. Omitted when no context is supplied.""" @overload def __init__( self, *, - type: Literal[RealtimeConversationItemType.MESSAGE], - content: list["_models.RealtimeConversationItemMessageUserContent"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + context: Optional[list["_models.OptimizationContext"]] = None, ) -> None: ... @overload @@ -21582,53 +21656,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = RealtimeConversationItemMessageType.USER # type: ignore + self.type = AgentOptimizationConfigurationType.PROMPT_OPTIMIZATION # type: ignore -class RealtimeConversationItemMessageUserContent( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeConversationItemMessageUserContent. +class ProtocolConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-protocol configuration for the agent endpoint. - :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], - Literal["input_image"] - :vartype type: str or str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar image_url: - :vartype image_url: str - :ivar detail: Is one of the following types: Literal["auto"], Literal["low"], Literal["high"] - :vartype detail: str or str or str - :ivar transcript: - :vartype transcript: str + :ivar activity: Configuration for the activity protocol. + :vartype activity: ~azure.ai.projects.models.ActivityProtocolConfiguration + :ivar responses: Configuration for the responses protocol. + :vartype responses: ~azure.ai.projects.models.ResponsesProtocolConfiguration + :ivar a2a: Configuration for the A2A protocol. + :vartype a2a: ~azure.ai.projects.models.A2AProtocolConfiguration + :ivar mcp: Configuration for the MCP protocol. + :vartype mcp: ~azure.ai.projects.models.McpProtocolConfiguration + :ivar invocations: Configuration for the invocations protocol. + :vartype invocations: ~azure.ai.projects.models.InvocationsProtocolConfiguration + :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. + :vartype invocations_ws: ~azure.ai.projects.models.InvocationsWsProtocolConfiguration """ - type: Optional[Literal["input_text", "input_audio", "input_image"]] = rest_field( + activity: Optional["_models.ActivityProtocolConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], - Literal[\"input_image\"]""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - detail: Optional[Literal["auto", "low", "high"]] = rest_field( + """Configuration for the activity protocol.""" + responses: Optional["_models.ResponsesProtocolConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Configuration for the responses protocol.""" + a2a: Optional["_models.A2AProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the A2A protocol.""" + mcp: Optional["_models.McpProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the MCP protocol.""" + invocations: Optional["_models.InvocationsProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the invocations protocol.""" + invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the WebSocket-based invocations protocol.""" @overload def __init__( self, *, - type: Optional[Literal["input_text", "input_audio", "input_image"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - image_url: Optional[str] = None, - detail: Optional[Literal["auto", "low", "high"]] = None, - transcript: Optional[str] = None, + activity: Optional["_models.ActivityProtocolConfiguration"] = None, + responses: Optional["_models.ResponsesProtocolConfiguration"] = None, + a2a: Optional["_models.A2AProtocolConfiguration"] = None, + mcp: Optional["_models.McpProtocolConfiguration"] = None, + invocations: Optional["_models.InvocationsProtocolConfiguration"] = None, + invocations_ws: Optional["_models.InvocationsWsProtocolConfiguration"] = None, ) -> None: ... @overload @@ -21642,40 +21724,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class ProtocolVersionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A record mapping for a single protocol and its version. - :ivar type: The type of the tool, i.e. ``function``. Default value is "function". - :vartype type: str - :ivar name: The name of the function. - :vartype name: str - :ivar description: The description of the function, including guidance on when and how to call - it, and guidance about what to tell the user when calling (if anything). - :vartype description: str - :ivar parameters: Parameters of the function in JSON Schema. - :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters + :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", + "mcp", "invocations", "voice", "invocations_ws", and "voice_conversation_engine". + :vartype protocol: str or ~azure.ai.projects.models.AgentEndpointProtocol + :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. + :vartype version: str """ - type: Optional[Literal["function"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the tool, i.e. ``function``. Default value is \"function\".""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the function, including guidance on when and how to call it, and guidance - about what to tell the user when calling (if anything).""" - parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( + protocol: Union[str, "_models.AgentEndpointProtocol"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Parameters of the function in JSON Schema.""" + """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", + \"invocations\", \"voice\", \"invocations_ws\", and \"voice_conversation_engine\".""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version string for the protocol, e.g. 'v0.1.1'. Required.""" @overload def __init__( self, *, - type: Optional[Literal["function"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, + protocol: Union[str, "_models.AgentEndpointProtocol"], + version: str, ) -> None: ... @overload @@ -21689,55 +21761,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeFunctionToolParameters(_Model): - """RealtimeFunctionToolParameters.""" - +class TelephonyTransferDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A destination for a telephony transfer target. -class RealtimeMCPApprovalRequest( - RealtimeConversationItem, discriminator="mcp_approval_request" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval request. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + PSTNTelephonyTransferDestination, SipTelephonyTransferDestination, + TeamsTelephonyTransferDestination - :ivar type: The type of the item. Always ``mcp_approval_request``. Required. - MCP_APPROVAL_REQUEST. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST - :ivar id: The unique ID of the approval request. Required. - :vartype id: str - :ivar server_label: The label of the MCP server making the request. Required. - :vartype server_label: str - :ivar name: The name of the tool to run. Required. - :vartype name: str - :ivar arguments: A JSON string of arguments for the tool. Required. - :vartype arguments: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar kind: The telephony transfer destination type. Required. Known values are: "pstn", + "teams", and "sip". + :vartype kind: str or ~azure.ai.projects.models.TelephonyTransferDestinationKind """ - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the approval request. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server making the request. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool to run. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of arguments for the tool. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The telephony transfer destination type. Required. Known values are: \"pstn\", \"teams\", and + \"sip\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, + kind: str, ) -> None: ... @overload @@ -21749,53 +21794,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class RealtimeMCPApprovalResponse( - RealtimeConversationItem, discriminator="mcp_approval_response" +class PSTNTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="pstn" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP approval response. + """A PSTN destination for a telephony transfer target. - :ivar type: The type of the item. Always ``mcp_approval_response``. Required. - MCP_APPROVAL_RESPONSE. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE - :ivar id: The unique ID of the approval response. Required. - :vartype id: str - :ivar approval_request_id: The ID of the approval request being answered. Required. - :vartype approval_request_id: str - :ivar approve: Whether the request was approved. Required. - :vartype approve: bool - :ivar reason: - :vartype reason: str - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar kind: The PSTN destination type. Required. A public switched telephone network + destination. + :vartype kind: str or ~azure.ai.projects.models.PSTN + :ivar value: The E.164 phone number to call. Required. + :vartype value: str """ - type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the approval response. Required.""" - approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request being answered. Required.""" - approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the request was approved. Required.""" - reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + kind: Literal[TelephonyTransferDestinationKind.PSTN] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The PSTN destination type. Required. A public switched telephone network destination.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The E.164 phone number to call. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - reason: Optional[str] = None, + value: str, ) -> None: ... @overload @@ -21807,23 +21829,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore + self.kind = TelephonyTransferDestinationKind.PSTN # type: ignore -class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeMCPError. +class QuestionParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A question about the request's input, with an optional correlation name. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError + QuestionParamChoice, QuestionParamPredicate, QuestionParamScore - :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and - "http_error". - :vartype type: str or ~azure.ai.projects.models.RealtimeMcpErrorType + :ivar type: Required. Known values are: "predicate", "choice", and "score". + :vartype type: str or ~azure.ai.projects.models.QuestionParamType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"protocol_error\", \"tool_execution_error\", and \"http_error\".""" + """Required. Known values are: \"predicate\", \"choice\", and \"score\".""" @overload def __init__( @@ -21843,32 +21864,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeMCPHTTPError( - RealtimeMCPError, discriminator="http_error" +class QuestionParamChoice( + QuestionParam, discriminator="choice" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP HTTP error. + """Choose from the supplied options based on the input. - :ivar type: Required. HTTP_ERROR. - :vartype type: str or ~azure.ai.projects.models.HTTP_ERROR - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str + :ivar type: The type of the object. Always ``choice``. Required. CHOICE. + :vartype type: str or ~azure.ai.projects.models.CHOICE + :ivar name: + :vartype name: str + :ivar instructions: Required. + :vartype instructions: str + :ivar choices: Provide between 2 and 255 choices. Each choice must be unique. Required. + :vartype choices: list[~azure.ai.projects.models.ChoiceOptionParam] """ - type: Literal[RealtimeMcpErrorType.HTTP_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. HTTP_ERROR.""" - code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[QuestionParamType.CHOICE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``choice``. Required. CHOICE.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" + choices: list["_models.ChoiceOptionParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Provide between 2 and 255 choices. Each choice must be unique. Required.""" @overload def __init__( self, *, - code: int, - message: str, + instructions: str, + choices: list["_models.ChoiceOptionParam"], + name: Optional[str] = None, ) -> None: ... @overload @@ -21880,48 +21905,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore + self.type = QuestionParamType.CHOICE # type: ignore -class RealtimeMCPListTools( - RealtimeConversationItem, discriminator="mcp_list_tools" +class QuestionParamPredicate( + QuestionParam, discriminator="predicate" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP list tools. + """Estimate how likely it is that a statement about the input is true. - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS - :ivar id: The unique ID of the list. - :vartype id: str - :ivar server_label: The label of the MCP server. Required. - :vartype server_label: str - :ivar tools: The tools available on the server. Required. - :vartype tools: list[~azure.ai.projects.models.MCPListToolsTool] - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar type: The type of the object. Always ``predicate``. Required. PREDICATE. + :vartype type: str or ~azure.ai.projects.models.PREDICATE + :ivar name: + :vartype name: str + :ivar instructions: Required. + :vartype instructions: str """ - type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the list.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server. Required.""" - tools: list["_models.MCPListToolsTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The tools available on the server. Required.""" - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + type: Literal[QuestionParamType.PREDICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``predicate``. Required. PREDICATE.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - id: Optional[str] = None, # pylint: disable=redefined-builtin + instructions: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -21933,35 +21944,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore + self.type = QuestionParamType.PREDICATE # type: ignore -class RealtimeMCPProtocolError( - RealtimeMCPError, discriminator="protocol_error" +class QuestionParamScore( + QuestionParam, discriminator="score" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP protocol error. + """Rate the input against the supplied ordered levels. - :ivar type: Required. PROTOCOL_ERROR. - :vartype type: str or ~azure.ai.projects.models.PROTOCOL_ERROR - :ivar code: Required. - :vartype code: int - :ivar message: Required. - :vartype message: str + :ivar type: The type of the object. Always ``score``. Required. SCORE. + :vartype type: str or ~azure.ai.projects.models.SCORE + :ivar name: + :vartype name: str + :ivar instructions: Required. + :vartype instructions: str + :ivar levels: Required. + :vartype levels: list[~azure.ai.projects.models.ScoreLevelParam] """ - type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. PROTOCOL_ERROR.""" - code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[QuestionParamType.SCORE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``score``. Required. SCORE.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + levels: list["_models.ScoreLevelParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload def __init__( self, *, - code: int, - message: str, + instructions: str, + levels: list["_models.ScoreLevelParam"], + name: Optional[str] = None, ) -> None: ... @overload @@ -21973,65 +21988,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore + self.type = QuestionParamType.SCORE # type: ignore -class RealtimeMCPToolCall( - RealtimeConversationItem, discriminator="mcp_call" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool call. +class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Configuration for Responsible AI (RAI) content filtering and safety features. - :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. - :vartype type: str or ~azure.ai.projects.models.MCP_CALL - :ivar id: The unique ID of the tool call. Required. - :vartype id: str - :ivar server_label: The label of the MCP server running the tool. Required. - :vartype server_label: str - :ivar name: The name of the tool that was run. Required. - :vartype name: str - :ivar arguments: A JSON string of the arguments passed to the tool. Required. - :vartype arguments: str - :ivar approval_request_id: - :vartype approval_request_id: str - :ivar output: - :vartype output: str - :ivar error: - :vartype error: ~azure.ai.projects.models.RealtimeMCPError - :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. - :vartype created_at: ~datetime.datetime - :ivar response_id: The id of the response that produced this item, when applicable. - :vartype response_id: str + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + :ivar invocations_moderation: Author-declared configuration telling the platform where + user/agent text lives in the agent-defined invocations request/response bodies, so + content-safety guardrails can extract and moderate it. Optional; a rai_config without it leaves + the invocations path without content-safety moderation. + :vartype invocations_moderation: ~azure.ai.projects.models.RaiInvocationModeration """ - type: Literal[RealtimeConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the tool call. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server running the tool. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool that was run. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of the arguments passed to the tool. Required.""" - approval_request_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - error: Optional["_models.RealtimeMCPError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The Unix timestamp (in seconds) for when the item was persisted.""" - response_id: Optional[str] = rest_field(visibility=["read"]) - """The id of the response that produced this item, when applicable.""" + rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the RAI policy to apply. Required.""" + invocations_moderation: Optional["_models.RaiInvocationModeration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Author-declared configuration telling the platform where user/agent text lives in the + agent-defined invocations request/response bodies, so content-safety guardrails can extract and + moderate it. Optional; a rai_config without it leaves the invocations path without + content-safety moderation.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, - approval_request_id: Optional[str] = None, - output: Optional[str] = None, - error: Optional["_models.RealtimeMCPError"] = None, + rai_policy_name: str, + invocations_moderation: Optional["_models.RaiInvocationModeration"] = None, ) -> None: ... @overload @@ -22043,30 +22030,67 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeConversationItemType.MCP_CALL # type: ignore -class RealtimeMCPToolExecutionError( - RealtimeMCPError, discriminator="tool_execution_error" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime MCP tool execution error. +class RaiInvocationModeration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Declares where request/response text lives so content-safety guardrails can extract it. - :ivar type: Required. TOOL_EXECUTION_ERROR. - :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR - :ivar message: Required. - :vartype message: str + :ivar input_content_type: How the REQUEST body is parsed. When omitted, the service defaults to + ``json``. Known values are: "json" and "text". + :vartype input_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType + :ivar output_content_type: How the RESPONSE body is parsed. When omitted, the service defaults + to ``json``. Known values are: "json" and "text". + :vartype output_content_type: str or ~azure.ai.projects.models.RaiInvocationContentType + :ivar response_mode: Author-declared response shape; drives which output gate runs and which + fields are required. Required. Known values are: "non_streaming", "streaming", and "both". + :vartype response_mode: str or ~azure.ai.projects.models.RaiInvocationMode + :ivar input_paths: Path(s) to user text in the REQUEST body. Required when input_content_type + is ``json``. + :vartype input_paths: list[str] + :ivar output_paths: Path(s) to agent text in a NON-STREAMING response body. Required when + response_mode is non_streaming/both and output_content_type is ``json``. + :vartype output_paths: list[str] + :ivar stream_selectors: One SSE event->field selector per event type carrying text. Required + when response_mode is streaming/both and output_content_type is ``json``. + :vartype stream_selectors: list[~azure.ai.projects.models.RaiSseTextSelector] """ - type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TOOL_EXECUTION_ERROR.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the REQUEST body is parsed. When omitted, the service defaults to ``json``. Known values + are: \"json\" and \"text\".""" + output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the RESPONSE body is parsed. When omitted, the service defaults to ``json``. Known values + are: \"json\" and \"text\".""" + response_mode: Union[str, "_models.RaiInvocationMode"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Author-declared response shape; drives which output gate runs and which fields are required. + Required. Known values are: \"non_streaming\", \"streaming\", and \"both\".""" + input_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Path(s) to user text in the REQUEST body. Required when input_content_type is ``json``.""" + output_paths: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Path(s) to agent text in a NON-STREAMING response body. Required when response_mode is + non_streaming/both and output_content_type is ``json``.""" + stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """One SSE event->field selector per event type carrying text. Required when response_mode is + streaming/both and output_content_type is ``json``.""" @overload def __init__( self, *, - message: str, + response_mode: Union[str, "_models.RaiInvocationMode"], + input_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, + output_content_type: Optional[Union[str, "_models.RaiInvocationContentType"]] = None, + input_paths: Optional[list[str]] = None, + output_paths: Optional[list[str]] = None, + stream_selectors: Optional[list["_models.RaiSseTextSelector"]] = None, ) -> None: ... @overload @@ -22078,26 +22102,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeMcpErrorType.TOOL_EXECUTION_ERROR # type: ignore -class RealtimeReasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Realtime reasoning configuration. +class RaiSseTextSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An SSE event-type to text-field selector for streaming invocation output. - :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". - :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort + :ivar event_type: The SSE event ``type`` value that carries text. Required. + :vartype event_type: str + :ivar text_field: The field on a matched event holding the text delta. When omitted, the + service defaults to ``delta``. + :vartype text_field: str """ - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + event_type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SSE event ``type`` value that carries text. Required.""" + text_field: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The field on a matched event holding the text delta. When omitted, the service defaults to + ``delta``.""" @overload def __init__( self, *, - effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = None, + event_type: str, + text_field: Optional[str] = None, ) -> None: ... @overload @@ -22111,40 +22139,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetails. +class RankingOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RankingOptions. - :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], - Literal["failed"], Literal["incomplete"] - :vartype type: str or str or str or str - :ivar reason: Is one of the following types: Literal["turn_detected"], - Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] - :vartype reason: str or str or str or str - :ivar error: - :vartype error: ~azure.ai.projects.models.RealtimeResponseStatusDetailsError + :ivar ranker: The ranker to use for the file search. Known values are: "auto" and + "default-2024-11-15". + :vartype ranker: str or ~azure.ai.projects.models.RankerVersionType + :ivar score_threshold: The score threshold for the file search, a number between 0 and 1. + Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer + results. + :vartype score_threshold: float + :ivar hybrid_search: Weights that control how reciprocal rank fusion balances semantic + embedding matches versus sparse keyword matches when hybrid search is enabled. + :vartype hybrid_search: ~azure.ai.projects.models.HybridSearchOptions """ - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], - Literal[\"failed\"], Literal[\"incomplete\"]""" - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = rest_field( + ranker: Optional[Union[str, "_models.RankerVersionType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], - Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" - error: Optional["_models.RealtimeResponseStatusDetailsError"] = rest_field( + """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" + score_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will + attempt to return only the most relevant results, but may return fewer results.""" + hybrid_search: Optional["_models.HybridSearchOptions"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """Weights that control how reciprocal rank fusion balances semantic embedding matches versus + sparse keyword matches when hybrid search is enabled.""" @overload def __init__( self, *, - type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = None, - reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None, - error: Optional["_models.RealtimeResponseStatusDetailsError"] = None, + ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, + score_threshold: Optional[float] = None, + hybrid_search: Optional["_models.HybridSearchOptions"] = None, ) -> None: ... @overload @@ -22158,72 +22187,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseStatusDetailsError. - - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - """ - - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: Optional[str] = None, - code: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - +class RealtimeAudioFormats(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormats. -class RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsage. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeAudioFormatsAudioPcm, RealtimeAudioFormatsAudioPcma, RealtimeAudioFormatsAudioPcmu - :ivar total_tokens: - :vartype total_tokens: int - :ivar input_tokens: - :vartype input_tokens: int - :ivar output_tokens: - :vartype output_tokens: int - :ivar input_token_details: - :vartype input_token_details: ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails - :ivar output_token_details: - :vartype output_token_details: - ~azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.projects.models.RealtimeAudioFormatsType """ - total_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" @overload def __init__( self, *, - total_tokens: Optional[int] = None, - input_tokens: Optional[int] = None, - output_tokens: Optional[int] = None, - input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = None, - output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = None, + type: str, ) -> None: ... @overload @@ -22237,39 +22219,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetails. +class RealtimeAudioFormatsAudioPcm( + RealtimeAudioFormats, discriminator="audio/pcm" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeAudioFormatsAudioPcm. - :ivar cached_tokens: - :vartype cached_tokens: int - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int - :ivar cached_tokens_details: - :vartype cached_tokens_details: - ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails + :ivar type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int """ - cached_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + type: Literal[RealtimeAudioFormatsType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCM.""" + rate: Optional[Literal[24000]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is 24000.""" @overload def __init__( self, *, - cached_tokens: Optional[int] = None, - text_tokens: Optional[int] = None, - image_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, - cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = None, + rate: Optional[Literal[24000]] = None, ) -> None: ... @overload @@ -22281,32 +22251,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeAudioFormatsType.AUDIO_PCM # type: ignore -class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. +class RealtimeAudioFormatsAudioPcma(RealtimeAudioFormats, discriminator="audio/pcma"): + """RealtimeAudioFormatsAudioPcma. - :ivar text_tokens: - :vartype text_tokens: int - :ivar image_tokens: - :vartype image_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :ivar type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMA """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" @overload def __init__( self, - *, - text_tokens: Optional[int] = None, - image_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -22318,26 +22278,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeAudioFormatsType.AUDIO_PCMA # type: ignore -class RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeResponseUsageOutputTokenDetails. +class RealtimeAudioFormatsAudioPcmu(RealtimeAudioFormats, discriminator="audio/pcmu"): + """RealtimeAudioFormatsAudioPcmu. - :ivar text_tokens: - :vartype text_tokens: int - :ivar audio_tokens: - :vartype audio_tokens: int + :ivar type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.projects.models.AUDIO_PCMU """ - text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[RealtimeAudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" @overload def __init__( self, - *, - text_tokens: Optional[int] = None, - audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -22349,107 +22305,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeAudioFormatsType.AUDIO_PCMU # type: ignore -class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A realtime server event. +class RealtimeClientEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime client event. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - RealtimeServerEventConversationItemAdded, RealtimeServerEventConversationItemCreated, - RealtimeServerEventConversationItemDeleted, RealtimeServerEventConversationItemDone, - RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, - RealtimeServerEventConversationItemInputAudioTranscriptionDelta, - RealtimeServerEventConversationItemInputAudioTranscriptionFailed, - RealtimeServerEventConversationItemInputAudioTranscriptionSegment, - RealtimeServerEventConversationItemRetrieved, RealtimeServerEventConversationItemTruncated, - RealtimeServerEventInputAudioBufferCleared, RealtimeServerEventInputAudioBufferCommitted, - RealtimeServerEventInputAudioBufferSpeechStarted, - RealtimeServerEventInputAudioBufferSpeechStopped, - RealtimeServerEventInputAudioBufferTimeoutTriggered, RealtimeServerEventMCPListToolsCompleted, - RealtimeServerEventMCPListToolsFailed, RealtimeServerEventMCPListToolsInProgress, - RealtimeServerEventOutputAudioBufferCleared, RealtimeServerEventRateLimitsUpdated, - VoiceAgentServerEventResponseAnimationBlendshapesDelta, - VoiceAgentServerEventResponseAnimationBlendshapesDone, - VoiceAgentServerEventResponseAnimationVisemeDelta, - VoiceAgentServerEventResponseAnimationVisemeDone, - VoiceAgentServerEventResponseAudioTimestampDelta, - VoiceAgentServerEventResponseAudioTimestampDone, RealtimeServerEventResponseContentPartAdded, - RealtimeServerEventResponseContentPartDone, RealtimeServerEventResponseCreated, - RealtimeServerEventResponseDone, RealtimeServerEventResponseFunctionCallArgumentsDelta, - RealtimeServerEventResponseFunctionCallArgumentsDone, - RealtimeServerEventResponseMCPCallCompleted, RealtimeServerEventResponseMCPCallFailed, - RealtimeServerEventResponseMCPCallInProgress, RealtimeServerEventResponseMCPCallArgumentsDelta, - RealtimeServerEventResponseMCPCallArgumentsDone, RealtimeServerEventResponseAudioDelta, - RealtimeServerEventResponseAudioDone, RealtimeServerEventResponseAudioTranscriptDelta, - RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseOutputItemAdded, - RealtimeServerEventResponseOutputItemDone, RealtimeServerEventResponseTextDelta, - RealtimeServerEventResponseTextDone, VoiceAgentServerEventResponseVideoDelta, - VoiceAgentServerEventRtcCallError, VoiceAgentServerEventRtcCallSdpCreated, - VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, - VoiceAgentServerEventSessionAvatarSwitchToSpeaking, RealtimeServerEventSessionCreated, - VoiceAgentServerEventSessionSubagentAborted, VoiceAgentServerEventSessionSubagentCompleted, - VoiceAgentServerEventSessionSubagentStarted, RealtimeServerEventSessionUpdated, - VoiceAgentServerEventWarning + RealtimeClientEventConversationItemCreate, RealtimeClientEventConversationItemDelete, + RealtimeClientEventConversationItemRetrieve, RealtimeClientEventConversationItemTruncate, + RealtimeClientEventInputAudioBufferAppend, RealtimeClientEventInputAudioBufferClear, + RealtimeClientEventInputAudioBufferCommit, RealtimeClientEventOutputAudioBufferClear, + RealtimeClientEventResponseCancel, RealtimeClientEventResponseCreate, + VoiceAgentClientEventRtcCallSdpCreate, VoiceAgentClientEventSessionAvatarConnect - :ivar type: Required. Known values are: "conversation.created", "conversation.item.created", - "conversation.item.deleted", "conversation.item.input_audio_transcription.completed", - "conversation.item.input_audio_transcription.delta", - "conversation.item.input_audio_transcription.failed", "conversation.item.retrieved", - "conversation.item.truncated", "error", "input_audio_buffer.cleared", - "input_audio_buffer.committed", "input_audio_buffer.dtmf_event_received", - "input_audio_buffer.speech_started", "input_audio_buffer.speech_stopped", - "rate_limits.updated", "response.output_audio.delta", "response.output_audio.done", - "response.output_audio_transcript.delta", "response.output_audio_transcript.done", - "response.content_part.added", "response.content_part.done", "response.created", - "response.done", "response.function_call_arguments.delta", - "response.function_call_arguments.done", "response.output_item.added", - "response.output_item.done", "response.output_text.delta", "response.output_text.done", - "session.created", "session.updated", "output_audio_buffer.started", - "output_audio_buffer.stopped", "output_audio_buffer.cleared", "conversation.item.added", - "conversation.item.done", "input_audio_buffer.timeout_triggered", - "conversation.item.input_audio_transcription.segment", "mcp_list_tools.in_progress", - "mcp_list_tools.completed", "mcp_list_tools.failed", "response.mcp_call_arguments.delta", - "response.mcp_call_arguments.done", "response.mcp_call.in_progress", - "response.mcp_call.completed", "response.mcp_call.failed", "warning", - "session.subagent.started", "session.subagent.completed", "session.subagent.aborted", - "session.avatar.connecting", "session.avatar.switch_to_speaking", - "session.avatar.switch_to_idle", "rtc.call.sdp.created", "rtc.call.error", - "response.audio_timestamp.delta", "response.audio_timestamp.done", - "response.animation_blendshapes.delta", "response.animation_blendshapes.done", - "response.animation_viseme.delta", "response.animation_viseme.done", and - "response.video.delta". - :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType + :ivar type: Required. Known values are: "conversation.item.create", "conversation.item.delete", + "conversation.item.retrieve", "conversation.item.truncate", "input_audio_buffer.append", + "input_audio_buffer.clear", "output_audio_buffer.clear", "input_audio_buffer.commit", + "response.cancel", "response.create", "session.update", "session.avatar.connect", and + "rtc.call.sdp.create". + :vartype type: str or ~azure.ai.projects.models.RealtimeClientEventType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"conversation.created\", \"conversation.item.created\", - \"conversation.item.deleted\", \"conversation.item.input_audio_transcription.completed\", - \"conversation.item.input_audio_transcription.delta\", - \"conversation.item.input_audio_transcription.failed\", \"conversation.item.retrieved\", - \"conversation.item.truncated\", \"error\", \"input_audio_buffer.cleared\", - \"input_audio_buffer.committed\", \"input_audio_buffer.dtmf_event_received\", - \"input_audio_buffer.speech_started\", \"input_audio_buffer.speech_stopped\", - \"rate_limits.updated\", \"response.output_audio.delta\", \"response.output_audio.done\", - \"response.output_audio_transcript.delta\", \"response.output_audio_transcript.done\", - \"response.content_part.added\", \"response.content_part.done\", \"response.created\", - \"response.done\", \"response.function_call_arguments.delta\", - \"response.function_call_arguments.done\", \"response.output_item.added\", - \"response.output_item.done\", \"response.output_text.delta\", \"response.output_text.done\", - \"session.created\", \"session.updated\", \"output_audio_buffer.started\", - \"output_audio_buffer.stopped\", \"output_audio_buffer.cleared\", \"conversation.item.added\", - \"conversation.item.done\", \"input_audio_buffer.timeout_triggered\", - \"conversation.item.input_audio_transcription.segment\", \"mcp_list_tools.in_progress\", - \"mcp_list_tools.completed\", \"mcp_list_tools.failed\", \"response.mcp_call_arguments.delta\", - \"response.mcp_call_arguments.done\", \"response.mcp_call.in_progress\", - \"response.mcp_call.completed\", \"response.mcp_call.failed\", \"warning\", - \"session.subagent.started\", \"session.subagent.completed\", \"session.subagent.aborted\", - \"session.avatar.connecting\", \"session.avatar.switch_to_speaking\", - \"session.avatar.switch_to_idle\", \"rtc.call.sdp.created\", \"rtc.call.error\", - \"response.audio_timestamp.delta\", \"response.audio_timestamp.done\", - \"response.animation_blendshapes.delta\", \"response.animation_blendshapes.done\", - \"response.animation_viseme.delta\", \"response.animation_viseme.done\", and - \"response.video.delta\".""" + """Required. Known values are: \"conversation.item.create\", \"conversation.item.delete\", + \"conversation.item.retrieve\", \"conversation.item.truncate\", \"input_audio_buffer.append\", + \"input_audio_buffer.clear\", \"output_audio_buffer.clear\", \"input_audio_buffer.commit\", + \"response.cancel\", \"response.create\", \"session.update\", \"session.avatar.connect\", and + \"rtc.call.sdp.create\".""" @overload def __init__( @@ -22469,36 +22353,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventConversationItemAdded( - RealtimeServerEvent, discriminator="conversation.item.added" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Sent by the server when an Item is added to the default Conversation. This can happen in - several cases: - - * When the client sends a `conversation.item.create` event. - * When the input audio buffer is committed. In this case the item will be a user message containing the audio from - the buffer. - * When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the - model starts generating a specific Item, and thus it will not yet have any content (and `status` will be - `in_progress`). The event will include the full content of the Item (except when model is generating a Response) - except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. +class RealtimeClientEventConversationItemCreate( + RealtimeClientEvent, discriminator="conversation.item.create" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Add a new Item to the Conversation's context, including messages, function calls, and function + call responses. This event can be used both to populate a "history" of the conversation and to + add new items mid-stream, but has the current limitation that it cannot populate assistant + audio messages. If successful, the server will emit a ``conversation.item.added`` event and, + when the item is finalized, a ``conversation.item.done`` event. Otherwise, an ``error`` event + will be sent. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.added``. Required. - CONVERSATION_ITEM_ADDED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_ADDED - :ivar previous_item_id: + :ivar type: The event type, must be ``conversation.item.create``. Required. + CONVERSATION_ITEM_CREATE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATE + :ivar previous_item_id: The ID of the preceding item after which the new item will be inserted. + If not set, the new item will be appended to the end of the conversation. If set to ``root``, + the new item will be added to the beginning of the conversation. If set to an existing ID, it + allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be + returned and the item will not be added. :vartype previous_item_id: str :ivar item: Required. :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the preceding item after which the new item will be inserted. If not set, the new + item will be appended to the end of the conversation. If set to ``root``, the new item will be + added to the beginning of the conversation. If set to an existing ID, it allows an item to be + inserted mid-conversation. If the ID cannot be found, an error will be returned and the item + will not be added.""" item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @@ -22506,8 +22395,8 @@ class RealtimeServerEventConversationItemAdded( def __init__( self, *, - event_id: str, item: "_models.RealtimeConversationItem", + event_id: Optional[str] = None, previous_item_id: Optional[str] = None, ) -> None: ... @@ -22520,47 +22409,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_ADDED # type: ignore + self.type = RealtimeClientEventType.CONVERSATION_ITEM_CREATE # type: ignore -class RealtimeServerEventConversationItemCreated( - RealtimeServerEvent, discriminator="conversation.item.created" +class RealtimeClientEventConversationItemDelete( + RealtimeClientEvent, discriminator="conversation.item.delete" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a conversation item is created. There are several scenarios that produce this - event: - - * The server is generating a Response, which if successful will produce either one or two Items, which will be of - type `message` (role `assistant`) or type `function_call`. - * The input audio buffer has been committed, either by the client or the server (in `server_vad` mode). The server - will take the content of the input audio buffer and add it to a new user message Item. - * The client has sent a `conversation.item.create` event to add a new Item to the Conversation. + """Send this event when you want to remove any item from the conversation history. The server will + respond with a ``conversation.item.deleted`` event, unless the item does not exist in the + conversation history, in which case the server will respond with an error. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.created``. Required. - CONVERSATION_ITEM_CREATED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar type: The event type, must be ``conversation.item.delete``. Required. + CONVERSATION_ITEM_DELETE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETE + :ivar item_id: The ID of the item to delete. Required. + :vartype item_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item to delete. Required.""" @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", - previous_item_id: Optional[str] = None, + item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22572,38 +22452,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_CREATED # type: ignore + self.type = RealtimeClientEventType.CONVERSATION_ITEM_DELETE # type: ignore -class RealtimeServerEventConversationItemDeleted( - RealtimeServerEvent, discriminator="conversation.item.deleted" +class RealtimeClientEventConversationItemRetrieve( + RealtimeClientEvent, discriminator="conversation.item.retrieve" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an item in the conversation is deleted by the client with a - ``conversation.item.delete`` event. This event is used to synchronize the server's - understanding of the conversation history with the client's view. + """Send this event when you want to retrieve the server's representation of a specific item in the + conversation history. This is useful, for example, to inspect user audio after noise + cancellation and VAD. The server will respond with a ``conversation.item.retrieved`` event, + unless the item does not exist in the conversation history, in which case the server will + respond with an error. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.deleted``. Required. - CONVERSATION_ITEM_DELETED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETED - :ivar item_id: The ID of the item that was deleted. Required. + :ivar type: The event type, must be ``conversation.item.retrieve``. Required. + CONVERSATION_ITEM_RETRIEVE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVE + :ivar item_id: The ID of the item to retrieve. Required. :vartype item_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item that was deleted. Required.""" + """The ID of the item to retrieve. Required.""" @overload def __init__( self, *, - event_id: str, item_id: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22615,42 +22497,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_DELETED # type: ignore + self.type = RealtimeClientEventType.CONVERSATION_ITEM_RETRIEVE # type: ignore -class RealtimeServerEventConversationItemDone( - RealtimeServerEvent, discriminator="conversation.item.done" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a conversation item is finalized. The event will include the full content of the - Item except for audio data, which can be retrieved separately with a - ``conversation.item.retrieve`` event if needed. +class RealtimeClientEventConversationItemTruncate( + RealtimeClientEvent, discriminator="conversation.item.truncate" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Send this event to truncate a previous assistant message’s audio. The server will produce audio + faster than realtime, so this event is useful when the user interrupts to truncate audio that + has already been sent to the client but not yet played. This will synchronize the server's + understanding of the audio with the client's playback. Truncating audio will delete the + server-side text transcript to ensure there is not text in the context that hasn't been heard + by the user. If successful, the server will respond with a ``conversation.item.truncated`` + event. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.done``. Required. - CONVERSATION_ITEM_DONE. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DONE - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar type: The event type, must be ``conversation.item.truncate``. Required. + CONVERSATION_ITEM_TRUNCATE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATE + :ivar item_id: The ID of the assistant message item to truncate. Only assistant message items + can be truncated. Required. + :vartype item_id: str + :ivar content_index: The index of the content part to truncate. Set this to ``0``. Required. + :vartype content_index: int + :ivar audio_end_ms: Inclusive duration up to which audio is truncated, in milliseconds. If the + audio_end_ms is greater than the actual audio duration, the server will respond with an error. + Required. + :vartype audio_end_ms: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the assistant message item to truncate. Only assistant message items can be + truncated. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part to truncate. Set this to ``0``. Required.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inclusive duration up to which audio is truncated, in milliseconds. If the audio_end_ms is + greater than the actual audio duration, the server will respond with an error. Required.""" @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", - previous_item_id: Optional[str] = None, + item_id: str, + content_index: int, + audio_end_ms: int, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22662,88 +22559,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_DONE # type: ignore + self.type = RealtimeClientEventType.CONVERSATION_ITEM_TRUNCATE # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.completed" +class RealtimeClientEventInputAudioBufferAppend( + RealtimeClientEvent, discriminator="input_audio_buffer.append" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """This event is the output of audio transcription for user audio written to the user audio - buffer. Transcription begins when the input audio buffer is committed by the client or server - (when VAD is enabled). Transcription runs asynchronously with Response creation, so this event - may come before or after the Response events. Realtime API models accept audio natively, and - thus input transcription is a separate process run on a separate ASR (Automatic Speech - Recognition) model. The transcript may diverge somewhat from the model's interpretation, and - should be treated as a rough guide. + """Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary + storage you can write to and later commit. A "commit" will create a new user message item in + the conversation history from the buffer content and clear the buffer. Input audio + transcription (if enabled) will be generated when the buffer is committed. If VAD is enabled + the audio buffer is used to detect speech and the server will decide when to commit. When + Server VAD is disabled, you must commit the audio buffer manually. Input audio noise reduction + operates on writes to the audio buffer. The client may choose how much audio to place in each + event up to a maximum of 15 MiB, for example streaming smaller chunks from the client may allow + the VAD to be more responsive. Unlike most other client events, the server will not send a + confirmation response to this event. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.completed``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED - :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. - :vartype item_id: str - :ivar content_index: The index of the content part containing the audio. Required. - :vartype content_index: int - :ivar transcript: The transcribed text. Required. - :vartype transcript: str - :ivar languages: The languages detected in the audio. Returned by ``gpt-transcribe``. An empty - array indicates that no language could be reliably detected. - :vartype languages: list[~azure.ai.projects.models.TranscriptionLanguage] - :ivar logprobs: - :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] - :ivar usage: Usage statistics for the transcription, this is billed according to the ASR - model's pricing rather than the realtime model's pricing. Required. Is either a - TranscriptTextUsageTokens type or a TranscriptTextUsageDuration type. - :vartype usage: ~azure.ai.projects.models.TranscriptTextUsageTokens or - ~azure.ai.projects.models.TranscriptTextUsageDuration - :ivar phrases: Phrase-level transcription timing and confidence details. - :vartype phrases: list[~azure.ai.projects.models.VoiceAgentTranscriptionPhrase] + :ivar type: The event type, must be ``input_audio_buffer.append``. Required. + INPUT_AUDIO_BUFFER_APPEND. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_APPEND + :ivar audio: Base64-encoded audio bytes. This must be in the format specified by the + ``input_audio_format`` field in the session configuration. Required. + :vartype audio: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part containing the audio. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed text. Required.""" - languages: Optional[list["_models.TranscriptionLanguage"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The languages detected in the audio. Returned by ``gpt-transcribe``. An empty array indicates - that no language could be reliably detected.""" - logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Usage statistics for the transcription, this is billed according to the ASR model's pricing - rather than the realtime model's pricing. Required. Is either a TranscriptTextUsageTokens type - or a TranscriptTextUsageDuration type.""" - phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Phrase-level transcription timing and confidence details.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded audio bytes. This must be in the format specified by the ``input_audio_format`` + field in the session configuration. Required.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - transcript: str, - usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], - languages: Optional[list["_models.TranscriptionLanguage"]] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = None, - phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, + audio: str, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22755,55 +22611,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED # type: ignore + self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_APPEND # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionDelta( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the text value of an input audio transcription content part is updated with - incremental transcription results. +class RealtimeClientEventInputAudioBufferClear( + RealtimeClientEvent, discriminator="input_audio_buffer.clear" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Send this event to clear the audio bytes in the buffer. The server will respond with an + ``input_audio_buffer.cleared`` event. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.delta``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA - :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. - :vartype item_id: str - :ivar content_index: The index of the content part in the item's content array. - :vartype content_index: int - :ivar delta: The text delta. - :vartype delta: str - :ivar logprobs: - :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] + :ivar type: The event type, must be ``input_audio_buffer.clear``. Required. + INPUT_AUDIO_BUFFER_CLEAR. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEAR """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item containing the audio that is being transcribed. Required.""" - content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array.""" - delta: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta.""" - logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: Optional[int] = None, - delta: Optional[str] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22815,53 +22648,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA # type: ignore + self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionFailed( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.failed" +class RealtimeClientEventInputAudioBufferCommit( + RealtimeClientEvent, discriminator="input_audio_buffer.commit" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when input audio transcription is configured, and a transcription request for a user - message failed. These events are separate from other ``error`` events so that the client can - identify the related Item. + """Send this event to commit the user input audio buffer, which will create a new user message + item in the conversation. This event will produce an error if the input audio buffer is empty. + When in Server VAD mode, the client does not need to send this event, the server will commit + the audio buffer automatically. Committing the input audio buffer will trigger input audio + transcription (if enabled in session configuration), but it will not create a response from + the model. The server will respond with an ``input_audio_buffer.committed`` event. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.failed``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED - :ivar item_id: The ID of the user message item. Required. - :vartype item_id: str - :ivar content_index: The index of the content part containing the audio. Required. - :vartype content_index: int - :ivar error: Details of the transcription error. Required. - :vartype error: - ~azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError + :ivar type: The event type, must be ``input_audio_buffer.commit``. Required. + INPUT_AUDIO_BUFFER_COMMIT. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMIT """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part containing the audio. Required.""" - error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Details of the transcription error. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22873,37 +22689,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED # type: ignore + self.type = RealtimeClientEventType.INPUT_AUDIO_BUFFER_COMMIT # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( - _Model +class RealtimeClientEventOutputAudioBufferClear( + RealtimeClientEvent, discriminator="output_audio_buffer.clear" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. + """**WebRTC/SIP Only:** Emit to cut off the current audio response. This will trigger the server + to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be + preceded by a ``response.cancel`` client event to stop the generation of the current response. + `Learn more + `_. - :ivar type: - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar param: - :vartype param: str + :ivar event_id: The unique ID of the client event used for error handling. + :vartype event_id: str + :ivar type: The event type, must be ``output_audio_buffer.clear``. Required. + OUTPUT_AUDIO_BUFFER_CLEAR. + :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEAR """ - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the client event used for error handling.""" + type: Literal[RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``output_audio_buffer.clear``. Required. OUTPUT_AUDIO_BUFFER_CLEAR.""" @overload def __init__( self, *, - type: Optional[str] = None, - code: Optional[str] = None, - message: Optional[str] = None, - param: Optional[str] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -22915,67 +22729,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR # type: ignore -class RealtimeServerEventConversationItemInputAudioTranscriptionSegment( - RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.segment" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an input audio transcription segment is identified for an item. +class RealtimeClientEventResponseCancel( + RealtimeClientEvent, discriminator="response.cancel" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Send this event to cancel an in-progress response. The server will respond with a + ``response.done`` event with a status of ``response.status=cancelled``. If there is no response + to cancel, the server will respond with an error. It's safe to call ``response.cancel`` even if + no response is in progress, an error will be returned the session will remain unaffected. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.segment``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT. - :vartype type: str or - ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT - :ivar item_id: The ID of the item containing the input audio content. Required. - :vartype item_id: str - :ivar content_index: The index of the input audio content part within the item. Required. - :vartype content_index: int - :ivar text: The text for this segment. Required. - :vartype text: str - :ivar id: The segment identifier. Required. - :vartype id: str - :ivar speaker: The detected speaker label for this segment. Required. - :vartype speaker: str - :ivar start: Start time of the segment in seconds. Required. - :vartype start: float - :ivar end: End time of the segment in seconds. Required. - :vartype end: float + :ivar type: The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CANCEL + :ivar response_id: A specific response ID to cancel - if not provided, will cancel an + in-progress response in the default conversation. + :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item containing the input audio content. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the input audio content part within the item. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text for this segment. Required.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The segment identifier. Required.""" - speaker: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The detected speaker label for this segment. Required.""" - start: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Start time of the segment in seconds. Required.""" - end: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """End time of the segment in seconds. Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.RESPONSE_CANCEL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A specific response ID to cancel - if not provided, will cancel an in-progress response in the + default conversation.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - text: str, - id: str, # pylint: disable=redefined-builtin - speaker: str, - start: float, - end: float, + event_id: Optional[str] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -22987,39 +22774,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT # type: ignore + self.type = RealtimeClientEventType.RESPONSE_CANCEL # type: ignore -class RealtimeServerEventConversationItemRetrieved( - RealtimeServerEvent, discriminator="conversation.item.retrieved" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a conversation item is retrieved with ``conversation.item.retrieve``. This is - provided as a way to fetch the server's representation of an item, for example to get access to - the post-processed audio data after noise cancellation and VAD. It includes the full content of - the Item, including audio data. +class RealtimeClientEventResponseCreate( + RealtimeClientEvent, discriminator="response.create" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """This event instructs the server to create a Response, which means triggering model inference. + When in Server VAD mode, the server will create Responses automatically. A Response will + include at least one Item, and may have two, in which case the second will be a function call. + These Items will be appended to the conversation history by default. The server will respond + with a ``response.created`` event, events for Items and content created, and finally a + ``response.done`` event to indicate the Response is complete. The ``response.create`` event + includes inference configuration like ``instructions`` and ``tools``. If these are set, they + will override the Session's configuration for this Response only. Responses can be created + out-of-band of the default Conversation, meaning that they can have arbitrary input, and it's + possible to disable writing the output to the Conversation. Only one Response can write to the + default Conversation at a time, but otherwise multiple Responses can be created in parallel. + The ``metadata`` field is a good way to disambiguate multiple simultaneous Responses. Clients + can set ``conversation`` to ``none`` to create a Response that does not write to the default + Conversation. Arbitrary input can be provided with the ``input`` field, which is an array + accepting raw Items and references to existing Items. - :ivar event_id: The unique ID of the server event. Required. + :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.retrieved``. Required. - CONVERSATION_ITEM_RETRIEVED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVED - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar type: The event type, must be ``response.create``. Required. RESPONSE_CREATE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATE + :ivar response: + :vartype response: ~azure.ai.projects.models.VoiceAgentResponseCreateParams """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional client-generated ID used to identify this event.""" + type: Literal[RealtimeClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" + response: Optional["_models.VoiceAgentResponseCreateParams"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - event_id: str, - item: "_models.RealtimeConversationItem", + event_id: Optional[str] = None, + response: Optional["_models.VoiceAgentResponseCreateParams"] = None, ) -> None: ... @overload @@ -23031,58 +22829,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED # type: ignore + self.type = RealtimeClientEventType.RESPONSE_CREATE # type: ignore -class RealtimeServerEventConversationItemTruncated( - RealtimeServerEvent, discriminator="conversation.item.truncated" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an earlier assistant audio message item is truncated by the client with a - ``conversation.item.truncate`` event. This event is used to synchronize the server's - understanding of the audio with the client's playback. This action will truncate the audio and - remove the server-side text transcript to ensure there is no text in the context that hasn't - been heard by the user. +class RealtimeConversationItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single item within a Realtime conversation. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.truncated``. Required. - CONVERSATION_ITEM_TRUNCATED. - :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATED - :ivar item_id: The ID of the assistant message item that was truncated. Required. - :vartype item_id: str - :ivar content_index: The index of the content part that was truncated. Required. - :vartype content_index: int - :ivar audio_end_ms: The duration up to which the audio was truncated, in milliseconds. - Required. - :vartype audio_end_ms: int - :ivar item: The assistant message after truncation, when the service returns the updated item. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeConversationItemFunctionCall, RealtimeConversationItemFunctionCallOutput, + RealtimeMCPApprovalRequest, RealtimeMCPApprovalResponse, RealtimeMCPToolCall, + RealtimeMCPListTools, RealtimeConversationItemMessage + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", "mcp_approval_request", and "message". + :vartype type: str or ~azure.ai.projects.models.RealtimeConversationItemType """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the assistant message item that was truncated. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part that was truncated. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The duration up to which the audio was truncated, in milliseconds. Required.""" - item: Optional["_models.RealtimeConversationItem"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The assistant message after truncation, when the service returns the updated item.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"function_call\", \"function_call_output\", + \"mcp_approval_response\", \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", and + \"message\".""" @overload def __init__( self, *, - event_id: str, - item_id: str, - content_index: int, - audio_end_ms: int, - item: Optional["_models.RealtimeConversationItem"] = None, + type: str, ) -> None: ... @overload @@ -23094,37 +22867,71 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED # type: ignore -class RealtimeServerEventError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when an error occurs, which could be a client problem or a server problem. Most errors - are recoverable and the session will stay open, we recommend to implementors to monitor and log - error messages by default. +class RealtimeConversationItemFunctionCall( + RealtimeConversationItem, discriminator="function_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime function call item. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``error``. Required. Default value is "error". - :vartype type: str - :ivar error: Details of the error. Required. - :vartype error: ~azure.ai.projects.models.RealtimeServerEventErrorError + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar call_id: The ID of the function call. + :vartype call_id: str + :ivar name: The name of the function being called. Required. + :vartype name: str + :ivar arguments: The arguments of the function call. This is a JSON-encoded string representing + the arguments passed to the function, for example ``{"arg1": "value1", "arg2": 42}``. Required. + :vartype arguments: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event type, must be ``error``. Required. Default value is \"error\".""" - error: "_models.RealtimeServerEventErrorError" = rest_field( + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Details of the error. Required.""" + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function being called. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The arguments of the function call. This is a JSON-encoded string representing the arguments + passed to the function, for example ``{\"arg1\": \"value1\", \"arg2\": 42}``. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - error: "_models.RealtimeServerEventErrorError", + name: str, + arguments: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + call_id: Optional[str] = None, ) -> None: ... @overload @@ -23136,41 +22943,75 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["error"] = "error" + self.type = RealtimeConversationItemType.FUNCTION_CALL # type: ignore -class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """RealtimeServerEventErrorError. +class RealtimeConversationItemFunctionCallOutput( + RealtimeConversationItem, discriminator="function_call_output" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Realtime function call output item. - :ivar type: Required. - :vartype type: str - :ivar code: - :vartype code: str - :ivar message: Required. - :vartype message: str - :ivar param: - :vartype param: str - :ivar event_id: - :vartype event_id: str + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar call_id: The ID of the function call this output is for. Required. + :vartype call_id: str + :ivar output: The output of the function call, this is free text and can contain any + information or simply be empty. Required. + :vartype output: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + :ivar name: The name of the function that was called. A Foundry extension: OpenAI's + function_call_output does not carry the function name, only ``call_id``. + :vartype name: str """ - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call this output is for. Required.""" + output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function that was called. A Foundry extension: OpenAI's function_call_output + does not carry the function name, only ``call_id``.""" @overload def __init__( self, *, - type: str, - message: str, - code: Optional[str] = None, - param: Optional[str] = None, - event_id: Optional[str] = None, + call_id: str, + output: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + name: Optional[str] = None, ) -> None: ... @overload @@ -23182,31 +23023,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore -class RealtimeServerEventInputAudioBufferCleared( - RealtimeServerEvent, discriminator="input_audio_buffer.cleared" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the input audio buffer is cleared by the client with a - ``input_audio_buffer.clear`` event. +class RealtimeConversationItemMessage( + RealtimeConversationItem, discriminator="message" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessage. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.cleared``. Required. - INPUT_AUDIO_BUFFER_CLEARED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEARED + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeConversationItemMessageAssistant, RealtimeConversationItemMessageSystem, + RealtimeConversationItemMessageUser + + :ivar role: Required. Known values are: "system", "user", and "assistant". + :vartype role: str or ~azure.ai.projects.models.RealtimeConversationItemMessageType + :ivar type: Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" + __mapping__: dict[str, _Model] = {} + role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"system\", \"user\", and \"assistant\".""" + type: Literal[RealtimeConversationItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MESSAGE.""" @overload def __init__( self, *, - event_id: str, + role: str, ) -> None: ... @overload @@ -23218,43 +23063,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED # type: ignore + self.type = RealtimeConversationItemType.MESSAGE # type: ignore -class RealtimeServerEventInputAudioBufferCommitted( - RealtimeServerEvent, discriminator="input_audio_buffer.committed" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an input audio buffer is committed, either by the client or automatically in - server VAD mode. The ``item_id`` property is the ID of the user message item that will be - created, thus a ``conversation.item.created`` event will also be sent to the client. +class RealtimeConversationItemMessageAssistant( + RealtimeConversationItemMessage, discriminator="assistant" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime assistant message item. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMITTED - :ivar previous_item_id: - :vartype previous_item_id: str - :ivar item_id: The ID of the user message item that will be created. Required. - :vartype item_id: str + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. + :vartype role: str or ~azure.ai.projects.models.ASSISTANT + :ivar content: The content of the message. Required. + :vartype content: + list[~azure.ai.projects.models.RealtimeConversationItemMessageAssistantContent] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" + content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - item_id: str, - previous_item_id: Optional[str] = None, + type: Literal[RealtimeConversationItemType.MESSAGE], + content: list["_models.RealtimeConversationItemMessageAssistantContent"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -23266,54 +23134,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED # type: ignore + self.role = RealtimeConversationItemMessageType.ASSISTANT # type: ignore -class RealtimeServerEventInputAudioBufferSpeechStarted( - RealtimeServerEvent, discriminator="input_audio_buffer.speech_started" +class RealtimeConversationItemMessageAssistantContent( + _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Sent by the server when in ``server_vad`` mode to indicate that speech has been detected in the - audio buffer. This can happen any time audio is added to the buffer (unless speech is already - detected). The client may want to use this event to interrupt audio playback or provide visual - feedback to the user. The client should expect to receive a - ``input_audio_buffer.speech_stopped`` event when speech stops. The ``item_id`` property is the - ID of the user message item that will be created when speech stops and will also be included in - the ``input_audio_buffer.speech_stopped`` event (unless the client manually commits the audio - buffer during VAD activation). + """RealtimeConversationItemMessageAssistantContent. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STARTED - :ivar audio_start_ms: Milliseconds from the start of all audio written to the buffer during the - session when speech was first detected. This will correspond to the beginning of audio sent to - the model, and thus includes the ``prefix_padding_ms`` configured in the Session. Required. - :vartype audio_start_ms: int - :ivar item_id: The ID of the user message item that will be created when speech stops. - Required. - :vartype item_id: str + :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" - audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Milliseconds from the start of all audio written to the buffer during the session when speech - was first detected. This will correspond to the beginning of audio sent to the model, and thus - includes the ``prefix_padding_ms`` configured in the Session. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created when speech stops. Required.""" + type: Optional[Literal["output_text", "output_audio"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - audio_start_ms: int, - item_id: str, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -23325,48 +23179,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED # type: ignore -class RealtimeServerEventInputAudioBufferSpeechStopped( - RealtimeServerEvent, discriminator="input_audio_buffer.speech_stopped" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned in ``server_vad`` mode when the server detects the end of speech in the audio buffer. - The server will also send an ``conversation.item.created`` event with the user message item - that is created from the audio buffer. +class RealtimeConversationItemMessageSystem( + RealtimeConversationItemMessage, discriminator="system" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime system message item. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STOPPED - :ivar audio_end_ms: Milliseconds since the session started when speech stopped. This will - correspond to the end of audio sent to the model, and thus includes the - ``min_silence_duration_ms`` configured in the Session. Required. - :vartype audio_end_ms: int - :ivar item_id: The ID of the user message item that will be created. Required. - :vartype item_id: str + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. + :vartype role: str or ~azure.ai.projects.models.SYSTEM + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageSystemContent] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Milliseconds since the session started when speech stopped. This will correspond to the end of - audio sent to the model, and thus includes the ``min_silence_duration_ms`` configured in the - Session. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``system``. Required. SYSTEM.""" + content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - audio_end_ms: int, - item_id: str, + type: Literal[RealtimeConversationItemType.MESSAGE], + content: list["_models.RealtimeConversationItemMessageSystemContent"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -23378,61 +23248,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED # type: ignore + self.role = RealtimeConversationItemMessageType.SYSTEM # type: ignore -class RealtimeServerEventInputAudioBufferTimeoutTriggered( - RealtimeServerEvent, discriminator="input_audio_buffer.timeout_triggered" +class RealtimeConversationItemMessageSystemContent( + _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the Server VAD timeout is triggered for the input audio buffer. This is - configured with ``idle_timeout_ms`` in the ``turn_detection`` settings of the session, and it - indicates that there hasn't been any speech detected for the configured duration. The - ``audio_start_ms`` and ``audio_end_ms`` fields indicate the segment of audio after the last - model response up to the triggering time, as an offset from the beginning of audio written to - the input audio buffer. This means it demarcates the segment of audio that was silent and the - difference between the start and end values will roughly match the configured timeout. The - empty audio will be committed to the conversation as an ``input_audio`` item (there will be a - ``input_audio_buffer.committed`` event) and a model response will be generated. There may be - speech that didn't trigger VAD but is still detected by the model, so the model may respond - with something relevant to the conversation or a prompt to continue speaking. + """RealtimeConversationItemMessageSystemContent. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.timeout_triggered``. Required. - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED - :ivar audio_start_ms: Millisecond offset of audio written to the input audio buffer that was - after the playback time of the last model response. Required. - :vartype audio_start_ms: int - :ivar audio_end_ms: Millisecond offset of audio written to the input audio buffer at the time - the timeout was triggered. Required. - :vartype audio_end_ms: int - :ivar item_id: The ID of the item associated with this segment. Required. - :vartype item_id: str + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: + :vartype text: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. - INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" - audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Millisecond offset of audio written to the input audio buffer that was after the playback time - of the last model response. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Millisecond offset of audio written to the input audio buffer at the time the timeout was - triggered. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with this segment. Required.""" + type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"input_text\".""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - audio_start_ms: int, - audio_end_ms: int, - item_id: str, + type: Optional[Literal["input_text"]] = None, + text: Optional[str] = None, ) -> None: ... @overload @@ -23444,36 +23283,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED # type: ignore -class RealtimeServerEventMCPListToolsCompleted( - RealtimeServerEvent, discriminator="mcp_list_tools.completed" +class RealtimeConversationItemMessageUser( + RealtimeConversationItemMessage, discriminator="user" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when listing MCP tools has completed for an item. - - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``mcp_list_tools.completed``. Required. - MCP_LIST_TOOLS_COMPLETED. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_COMPLETED - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str - """ - - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP list tools item. Required.""" + """Realtime user message item. - @overload - def __init__( - self, - *, - event_id: str, - item_id: str, + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. + :vartype id: str + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. MESSAGE. + :vartype type: str or ~azure.ai.projects.models.MESSAGE + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``user``. Required. USER. + :vartype role: str or ~azure.ai.projects.models.USER + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.projects.models.RealtimeConversationItemMessageUserContent] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``user``. Required. USER.""" + content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" + + @overload + def __init__( + self, + *, + type: Literal[RealtimeConversationItemType.MESSAGE], + content: list["_models.RealtimeConversationItemMessageUserContent"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -23485,35 +23352,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED # type: ignore + self.role = RealtimeConversationItemMessageType.USER # type: ignore -class RealtimeServerEventMCPListToolsFailed( - RealtimeServerEvent, discriminator="mcp_list_tools.failed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when listing MCP tools has failed for an item. +class RealtimeConversationItemMessageUserContent( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeConversationItemMessageUserContent. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_FAILED - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str + :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], + Literal["input_image"] + :vartype type: str or str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar image_url: + :vartype image_url: str + :ivar detail: Is one of the following types: Literal["auto"], Literal["low"], Literal["high"] + :vartype detail: str or str or str + :ivar transcript: + :vartype transcript: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP list tools item. Required.""" + type: Optional[Literal["input_text", "input_audio", "input_image"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], + Literal[\"input_image\"]""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + detail: Optional[Literal["auto", "low", "high"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - item_id: str, + type: Optional[Literal["input_text", "input_audio", "input_image"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + image_url: Optional[str] = None, + detail: Optional[Literal["auto", "low", "high"]] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -23525,36 +23410,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.MCP_LIST_TOOLS_FAILED # type: ignore -class RealtimeServerEventMCPListToolsInProgress( - RealtimeServerEvent, discriminator="mcp_list_tools.in_progress" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when listing MCP tools is in progress for an item. +class RealtimeFunctionTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``mcp_list_tools.in_progress``. Required. - MCP_LIST_TOOLS_IN_PROGRESS. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_IN_PROGRESS - :ivar item_id: The ID of the MCP list tools item. Required. - :vartype item_id: str + :ivar type: The type of the tool, i.e. ``function``. Default value is "function". + :vartype type: str + :ivar name: The name of the function. + :vartype name: str + :ivar description: The description of the function, including guidance on when and how to call + it, and guidance about what to tell the user when calling (if anything). + :vartype description: str + :ivar parameters: Parameters of the function in JSON Schema. + :vartype parameters: ~azure.ai.projects.models.RealtimeFunctionToolParameters """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP list tools item. Required.""" + type: Optional[Literal["function"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the tool, i.e. ``function``. Default value is \"function\".""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the function, including guidance on when and how to call it, and guidance + about what to tell the user when calling (if anything).""" + parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters of the function in JSON Schema.""" @overload def __init__( self, *, - event_id: str, - item_id: str, + type: Optional[Literal["function"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -23566,40 +23457,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS # type: ignore -class RealtimeServerEventOutputAudioBufferCleared( - RealtimeServerEvent, discriminator="output_audio_buffer.cleared" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """**WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This happens either in - VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the - client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current - audio response. `Learn more - `_. +class RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.cleared``. Required. - OUTPUT_AUDIO_BUFFER_CLEARED. - :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEARED - :ivar response_id: The unique ID of the response that produced the audio. Required. + +class RealtimeMCPApprovalRequest( + RealtimeConversationItem, discriminator="mcp_approval_request" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP approval request. + + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST + :ivar id: The unique ID of the approval request. Required. + :vartype id: str + :ivar server_label: The label of the MCP server making the request. Required. + :vartype server_label: str + :ivar name: The name of the tool to run. Required. + :vartype name: str + :ivar arguments: A JSON string of arguments for the tool. Required. + :vartype arguments: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the response that produced the audio. Required.""" + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval request. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server making the request. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool to run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of arguments for the tool. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - response_id: str, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -23611,40 +23519,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore + self.type = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class RealtimeServerEventRateLimitsUpdated( - RealtimeServerEvent, discriminator="rate_limits.updated" +class RealtimeMCPApprovalResponse( + RealtimeConversationItem, discriminator="mcp_approval_response" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is - created some tokens will be "reserved" for the output tokens, the rate limits shown here - reflect that reservation, which is then adjusted accordingly once the Response is completed. + """Realtime MCP approval response. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED. - :vartype type: str or ~azure.ai.projects.models.RATE_LIMITS_UPDATED - :ivar rate_limits: List of rate limit information. Required. - :vartype rate_limits: - list[~azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits] + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE + :ivar id: The unique ID of the approval response. Required. + :vartype id: str + :ivar approval_request_id: The ID of the approval request being answered. Required. + :vartype approval_request_id: str + :ivar approve: Whether the request was approved. Required. + :vartype approve: bool + :ivar reason: + :vartype reason: str + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" - rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of rate limit information. Required.""" + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval response. Required.""" + approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the approval request being answered. Required.""" + approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the request was approved. Required.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + reason: Optional[str] = None, ) -> None: ... @overload @@ -23656,40 +23577,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RATE_LIMITS_UPDATED # type: ignore + self.type = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore -class RealtimeServerEventRateLimitsUpdatedRateLimits( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventRateLimitsUpdatedRateLimits. +class RealtimeMCPError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeMCPError. - :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. - :vartype name: str or str - :ivar limit: - :vartype limit: int - :ivar remaining: - :vartype remaining: int - :ivar reset_seconds: - :vartype reset_seconds: float + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeMCPHTTPError, RealtimeMCPProtocolError, RealtimeMCPToolExecutionError + + :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and + "http_error". + :vartype type: str or ~azure.ai.projects.models.RealtimeMcpErrorType """ - name: Optional[Literal["requests", "tokens"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" - limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - remaining: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - reset_seconds: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"protocol_error\", \"tool_execution_error\", and \"http_error\".""" @overload def __init__( self, *, - name: Optional[Literal["requests", "tokens"]] = None, - limit: Optional[int] = None, - remaining: Optional[int] = None, - reset_seconds: Optional[float] = None, + type: str, ) -> None: ... @overload @@ -23703,53 +23613,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventResponseAudioDelta( - RealtimeServerEvent, discriminator="response.output_audio.delta" +class RealtimeMCPHTTPError( + RealtimeMCPError, discriminator="http_error" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the model-generated audio is updated. + """Realtime MCP HTTP error. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio.delta``. Required. - RESPONSE_OUTPUT_AUDIO_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: Base64-encoded audio data delta. Required. - :vartype delta: bytes + :ivar type: Required. HTTP_ERROR. + :vartype type: str or ~azure.ai.projects.models.HTTP_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") - """Base64-encoded audio data delta. Required.""" + type: Literal[RealtimeMcpErrorType.HTTP_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. HTTP_ERROR.""" + code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: bytes, + code: int, + message: str, ) -> None: ... @overload @@ -23761,52 +23650,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA # type: ignore + self.type = RealtimeMcpErrorType.HTTP_ERROR # type: ignore -class RealtimeServerEventResponseAudioDone( - RealtimeServerEvent, discriminator="response.output_audio.done" +class RealtimeMCPListTools( + RealtimeConversationItem, discriminator="mcp_list_tools" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the model-generated audio is done. Also emitted when a Response is interrupted, - incomplete, or cancelled. + """Realtime MCP list tools. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio.done``. Required. - RESPONSE_OUTPUT_AUDIO_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DONE - :ivar response_id: The ID of the response. Required. + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS + :ivar id: The unique ID of the list. + :vartype id: str + :ivar server_label: The label of the MCP server. Required. + :vartype server_label: str + :ivar tools: The tools available on the server. Required. + :vartype tools: list[~azure.ai.projects.models.MCPListToolsTool] + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the list.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server. Required.""" + tools: list["_models.MCPListToolsTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tools available on the server. Required.""" + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, + server_label: str, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -23818,57 +23703,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE # type: ignore + self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore -class RealtimeServerEventResponseAudioTranscriptDelta( - RealtimeServerEvent, discriminator="response.output_audio_transcript.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated transcription of audio output is updated. +class RealtimeMCPProtocolError( + RealtimeMCPError, discriminator="protocol_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP protocol error. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio_transcript.delta``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: The transcript delta. Required. - :vartype delta: str + :ivar type: Required. PROTOCOL_ERROR. + :vartype type: str or ~azure.ai.projects.models.PROTOCOL_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio_transcript.delta``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcript delta. Required.""" + type: Literal[RealtimeMcpErrorType.PROTOCOL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROTOCOL_ERROR.""" + code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: str, + code: int, + message: str, ) -> None: ... @overload @@ -23880,58 +23743,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA # type: ignore + self.type = RealtimeMcpErrorType.PROTOCOL_ERROR # type: ignore -class RealtimeServerEventResponseAudioTranscriptDone( - RealtimeServerEvent, discriminator="response.output_audio_transcript.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated transcription of audio output is done streaming. Also emitted - when a Response is interrupted, incomplete, or cancelled. +class RealtimeMCPToolCall( + RealtimeConversationItem, discriminator="mcp_call" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP tool call. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.output_audio_transcript.done``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar transcript: The final transcript of the audio. Required. - :vartype transcript: str + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: str or ~azure.ai.projects.models.MCP_CALL + :ivar id: The unique ID of the tool call. Required. + :vartype id: str + :ivar server_label: The label of the MCP server running the tool. Required. + :vartype server_label: str + :ivar name: The name of the tool that was run. Required. + :vartype name: str + :ivar arguments: A JSON string of the arguments passed to the tool. Required. + :vartype arguments: str + :ivar approval_request_id: + :vartype approval_request_id: str + :ivar output: + :vartype output: str + :ivar error: + :vartype error: ~azure.ai.projects.models.RealtimeMCPError + :ivar created_at: The Unix timestamp (in seconds) for when the item was persisted. + :vartype created_at: ~datetime.datetime + :ivar response_id: The id of the response that produced this item, when applicable. + :vartype response_id: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_audio_transcript.done``. Required. - RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final transcript of the audio. Required.""" + type: Literal[RealtimeConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the tool call. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server running the tool. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool that was run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error: Optional["_models.RealtimeMCPError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + created_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") + """The Unix timestamp (in seconds) for when the item was persisted.""" + response_id: Optional[str] = rest_field(visibility=["read"]) + """The id of the response that produced this item, when applicable.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - transcript: str, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, + approval_request_id: Optional[str] = None, + output: Optional[str] = None, + error: Optional["_models.RealtimeMCPError"] = None, ) -> None: ... @overload @@ -23943,59 +23813,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE # type: ignore + self.type = RealtimeConversationItemType.MCP_CALL # type: ignore -class RealtimeServerEventResponseContentPartAdded( - RealtimeServerEvent, discriminator="response.content_part.added" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a new content part is added to an assistant message item during response - generation. +class RealtimeMCPToolExecutionError( + RealtimeMCPError, discriminator="tool_execution_error" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime MCP tool execution error. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.content_part.added``. Required. - RESPONSE_CONTENT_PART_ADDED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_ADDED - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item to which the content part was added. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar part: The content part that was added. Required. - :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: str or ~azure.ai.projects.models.TOOL_EXECUTION_ERROR + :ivar message: Required. + :vartype message: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to which the content part was added. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - part: "_models.RealtimeServerEventResponseContentPartAddedPart" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content part that was added. Required.""" + type: Literal[RealtimeMcpErrorType.TOOL_EXECUTION_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TOOL_EXECUTION_ERROR.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.RealtimeServerEventResponseContentPartAddedPart", + message: str, ) -> None: ... @overload @@ -24007,38 +23848,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED # type: ignore + self.type = RealtimeMcpErrorType.TOOL_EXECUTION_ERROR # type: ignore -class RealtimeServerEventResponseContentPartAddedPart( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventResponseContentPartAddedPart. +class RealtimeReasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Realtime reasoning configuration. - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.RealtimeReasoningEffort """ - type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" @overload def __init__( self, *, - type: Optional[Literal["audio", "text"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, + effort: Optional[Union[str, "_models.RealtimeReasoningEffort"]] = None, ) -> None: ... @overload @@ -24052,56 +23881,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventResponseContentPartDone( - RealtimeServerEvent, discriminator="response.content_part.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a content part is done streaming in an assistant message item. Also emitted when - a Response is interrupted, incomplete, or cancelled. +class RealtimeResponseStatusDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetails. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.content_part.done``. Required. - RESPONSE_CONTENT_PART_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar part: The content part that is done. Required. - :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart + :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], + Literal["failed"], Literal["incomplete"] + :vartype type: str or str or str or str + :ivar reason: Is one of the following types: Literal["turn_detected"], + Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] + :vartype reason: str or str or str or str + :ivar error: + :vartype error: ~azure.ai.projects.models.RealtimeResponseStatusDetailsError """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - part: "_models.RealtimeServerEventResponseContentPartDonePart" = rest_field( + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], + Literal[\"failed\"], Literal[\"incomplete\"]""" + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], + Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" + error: Optional["_models.RealtimeResponseStatusDetailsError"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The content part that is done. Required.""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.RealtimeServerEventResponseContentPartDonePart", + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = None, + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None, + error: Optional["_models.RealtimeResponseStatusDetailsError"] = None, ) -> None: ... @overload @@ -24113,45 +23926,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE # type: ignore -class RealtimeServerEventResponseContentPartDonePart( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """RealtimeServerEventResponseContentPartDonePart. +class RealtimeResponseStatusDetailsError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseStatusDetailsError. - :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. - :vartype type: str or str - :ivar text: - :vartype text: str - :ivar audio: - :vartype audio: str - :ivar transcript: - :vartype transcript: str - :ivar format: The audio format, when this is an audio content part. - :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str """ - type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - format: Optional["_models.RealtimeAudioFormats"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The audio format, when this is an audio content part.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: Optional[Literal["audio", "text"]] = None, - text: Optional[str] = None, - audio: Optional[str] = None, - transcript: Optional[str] = None, - format: Optional["_models.RealtimeAudioFormats"] = None, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, ) -> None: ... @overload @@ -24165,35 +23963,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RealtimeServerEventResponseCreated( - RealtimeServerEvent, discriminator="response.created" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a new Response is created. The first event of response creation, where the - response is in an initial state of ``in_progress``. +class RealtimeResponseUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsage. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.created``. Required. RESPONSE_CREATED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATED - :ivar response: Required. - :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + :ivar total_tokens: + :vartype total_tokens: int + :ivar input_tokens: + :vartype input_tokens: int + :ivar output_tokens: + :vartype output_tokens: int + :ivar input_token_details: + :vartype input_token_details: ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetails + :ivar output_token_details: + :vartype output_token_details: + ~azure.ai.projects.models.RealtimeResponseUsageOutputTokenDetails """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( + total_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" @overload def __init__( self, *, - event_id: str, - response: "_models.VoiceAgentRealtimeResponse", + total_tokens: Optional[int] = None, + input_tokens: Optional[int] = None, + output_tokens: Optional[int] = None, + input_token_details: Optional["_models.RealtimeResponseUsageInputTokenDetails"] = None, + output_token_details: Optional["_models.RealtimeResponseUsageOutputTokenDetails"] = None, ) -> None: ... @overload @@ -24205,42 +24009,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_CREATED # type: ignore -class RealtimeServerEventResponseDone( - RealtimeServerEvent, discriminator="response.done" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a Response is done streaming. Always emitted, no matter the final state. The - Response object included in the ``response.done`` event will include all output Items in the - Response but will omit the raw audio data. Clients should check the ``status`` field of the - Response to determine if it was successful (``completed``) or if there was another outcome: - ``cancelled``, ``failed``, or ``incomplete``. A response will contain all output items that - were generated during the response, excluding any audio content. +class RealtimeResponseUsageInputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageInputTokenDetails. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.done``. Required. RESPONSE_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_DONE - :ivar response: Required. - :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse + :ivar cached_tokens: + :vartype cached_tokens: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + :ivar cached_tokens_details: + :vartype cached_tokens_details: + ~azure.ai.projects.models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: "_models.VoiceAgentRealtimeResponse" = rest_field( + cached_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" @overload def __init__( self, *, - event_id: str, - response: "_models.VoiceAgentRealtimeResponse", + cached_tokens: Optional[int] = None, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, + cached_tokens_details: Optional["_models.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails"] = None, ) -> None: ... @overload @@ -24252,57 +24055,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_DONE # type: ignore -class RealtimeServerEventResponseFunctionCallArgumentsDelta( - RealtimeServerEvent, discriminator="response.function_call_arguments.delta" +class RealtimeResponseUsageInputTokenDetailsCachedTokensDetails( + _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated function call arguments are updated. + """RealtimeResponseUsageInputTokenDetailsCachedTokensDetails. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the function call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar call_id: The ID of the function call. Required. - :vartype call_id: str - :ivar delta: The arguments delta as a JSON string. Required. - :vartype delta: str + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments delta as a JSON string. Required.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - call_id: str, - delta: str, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -24314,63 +24092,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore -class RealtimeServerEventResponseFunctionCallArgumentsDone( - RealtimeServerEvent, discriminator="response.function_call_arguments.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when the model-generated function call arguments are done streaming. Also emitted when - a Response is interrupted, incomplete, or cancelled. +class RealtimeResponseUsageOutputTokenDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeResponseUsageOutputTokenDetails. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the function call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar call_id: The ID of the function call. Required. - :vartype call_id: str - :ivar name: The name of the function that was called. Required. - :vartype name: str - :ivar arguments: The final arguments as a JSON string. Required. - :vartype arguments: str + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function that was called. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final arguments as a JSON string. Required.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - call_id: str, - name: str, - arguments: str, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -24382,113 +24123,113 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore - - -class RealtimeServerEventResponseMCPCallArgumentsDelta( - RealtimeServerEvent, discriminator="response.mcp_call_arguments.delta" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when MCP tool call arguments are updated during response generation. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call_arguments.delta``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar delta: The JSON-encoded arguments delta. Required. - :vartype delta: str - :ivar obfuscation: - :vartype obfuscation: str - """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call_arguments.delta``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON-encoded arguments delta. Required.""" - obfuscation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) +class RealtimeServerEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A realtime server event. - @overload - def __init__( - self, - *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - delta: str, - obfuscation: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA # type: ignore - - -class RealtimeServerEventResponseMCPCallArgumentsDone( - RealtimeServerEvent, discriminator="response.mcp_call_arguments.done" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when MCP tool call arguments are finalized during response generation. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + RealtimeServerEventConversationItemAdded, RealtimeServerEventConversationItemCreated, + RealtimeServerEventConversationItemDeleted, RealtimeServerEventConversationItemDone, + RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + RealtimeServerEventConversationItemInputAudioTranscriptionFailed, + RealtimeServerEventConversationItemInputAudioTranscriptionSegment, + RealtimeServerEventConversationItemRetrieved, RealtimeServerEventConversationItemTruncated, + RealtimeServerEventInputAudioBufferCleared, RealtimeServerEventInputAudioBufferCommitted, + RealtimeServerEventInputAudioBufferSpeechStarted, + RealtimeServerEventInputAudioBufferSpeechStopped, + RealtimeServerEventInputAudioBufferTimeoutTriggered, RealtimeServerEventMCPListToolsCompleted, + RealtimeServerEventMCPListToolsFailed, RealtimeServerEventMCPListToolsInProgress, + RealtimeServerEventOutputAudioBufferCleared, RealtimeServerEventRateLimitsUpdated, + VoiceAgentServerEventResponseAnimationBlendshapesDelta, + VoiceAgentServerEventResponseAnimationBlendshapesDone, + VoiceAgentServerEventResponseAnimationVisemeDelta, + VoiceAgentServerEventResponseAnimationVisemeDone, + VoiceAgentServerEventResponseAudioTimestampDelta, + VoiceAgentServerEventResponseAudioTimestampDone, RealtimeServerEventResponseContentPartAdded, + RealtimeServerEventResponseContentPartDone, RealtimeServerEventResponseCreated, + RealtimeServerEventResponseDone, RealtimeServerEventResponseFunctionCallArgumentsDelta, + RealtimeServerEventResponseFunctionCallArgumentsDone, + RealtimeServerEventResponseMCPCallCompleted, RealtimeServerEventResponseMCPCallFailed, + RealtimeServerEventResponseMCPCallInProgress, RealtimeServerEventResponseMCPCallArgumentsDelta, + RealtimeServerEventResponseMCPCallArgumentsDone, RealtimeServerEventResponseAudioDelta, + RealtimeServerEventResponseAudioDone, RealtimeServerEventResponseAudioTranscriptDelta, + RealtimeServerEventResponseAudioTranscriptDone, RealtimeServerEventResponseOutputItemAdded, + RealtimeServerEventResponseOutputItemDone, RealtimeServerEventResponseTextDelta, + RealtimeServerEventResponseTextDone, VoiceAgentServerEventResponseVideoDelta, + VoiceAgentServerEventRtcCallError, VoiceAgentServerEventRtcCallSdpCreated, + VoiceAgentServerEventSessionAvatarConnecting, VoiceAgentServerEventSessionAvatarSwitchToIdle, + VoiceAgentServerEventSessionAvatarSwitchToSpeaking, RealtimeServerEventSessionCreated, + VoiceAgentServerEventSessionSubagentAborted, VoiceAgentServerEventSessionSubagentCompleted, + VoiceAgentServerEventSessionSubagentStarted, RealtimeServerEventSessionUpdated, + VoiceAgentServerEventWarning - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call_arguments.done``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar arguments: The final JSON-encoded arguments string. Required. - :vartype arguments: str + :ivar type: Required. Known values are: "conversation.created", "conversation.item.created", + "conversation.item.deleted", "conversation.item.input_audio_transcription.completed", + "conversation.item.input_audio_transcription.delta", + "conversation.item.input_audio_transcription.failed", "conversation.item.retrieved", + "conversation.item.truncated", "error", "input_audio_buffer.cleared", + "input_audio_buffer.committed", "input_audio_buffer.dtmf_event_received", + "input_audio_buffer.speech_started", "input_audio_buffer.speech_stopped", + "rate_limits.updated", "response.output_audio.delta", "response.output_audio.done", + "response.output_audio_transcript.delta", "response.output_audio_transcript.done", + "response.content_part.added", "response.content_part.done", "response.created", + "response.done", "response.function_call_arguments.delta", + "response.function_call_arguments.done", "response.output_item.added", + "response.output_item.done", "response.output_text.delta", "response.output_text.done", + "session.created", "session.updated", "output_audio_buffer.started", + "output_audio_buffer.stopped", "output_audio_buffer.cleared", "conversation.item.added", + "conversation.item.done", "input_audio_buffer.timeout_triggered", + "conversation.item.input_audio_transcription.segment", "mcp_list_tools.in_progress", + "mcp_list_tools.completed", "mcp_list_tools.failed", "response.mcp_call_arguments.delta", + "response.mcp_call_arguments.done", "response.mcp_call.in_progress", + "response.mcp_call.completed", "response.mcp_call.failed", "warning", + "session.subagent.started", "session.subagent.completed", "session.subagent.aborted", + "session.avatar.connecting", "session.avatar.switch_to_speaking", + "session.avatar.switch_to_idle", "rtc.call.sdp.created", "rtc.call.error", + "response.audio_timestamp.delta", "response.audio_timestamp.done", + "response.animation_blendshapes.delta", "response.animation_blendshapes.done", + "response.animation_viseme.delta", "response.animation_viseme.done", and + "response.video.delta". + :vartype type: str or ~azure.ai.projects.models.RealtimeServerEventType """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call_arguments.done``. Required. - RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final JSON-encoded arguments string. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"conversation.created\", \"conversation.item.created\", + \"conversation.item.deleted\", \"conversation.item.input_audio_transcription.completed\", + \"conversation.item.input_audio_transcription.delta\", + \"conversation.item.input_audio_transcription.failed\", \"conversation.item.retrieved\", + \"conversation.item.truncated\", \"error\", \"input_audio_buffer.cleared\", + \"input_audio_buffer.committed\", \"input_audio_buffer.dtmf_event_received\", + \"input_audio_buffer.speech_started\", \"input_audio_buffer.speech_stopped\", + \"rate_limits.updated\", \"response.output_audio.delta\", \"response.output_audio.done\", + \"response.output_audio_transcript.delta\", \"response.output_audio_transcript.done\", + \"response.content_part.added\", \"response.content_part.done\", \"response.created\", + \"response.done\", \"response.function_call_arguments.delta\", + \"response.function_call_arguments.done\", \"response.output_item.added\", + \"response.output_item.done\", \"response.output_text.delta\", \"response.output_text.done\", + \"session.created\", \"session.updated\", \"output_audio_buffer.started\", + \"output_audio_buffer.stopped\", \"output_audio_buffer.cleared\", \"conversation.item.added\", + \"conversation.item.done\", \"input_audio_buffer.timeout_triggered\", + \"conversation.item.input_audio_transcription.segment\", \"mcp_list_tools.in_progress\", + \"mcp_list_tools.completed\", \"mcp_list_tools.failed\", \"response.mcp_call_arguments.delta\", + \"response.mcp_call_arguments.done\", \"response.mcp_call.in_progress\", + \"response.mcp_call.completed\", \"response.mcp_call.failed\", \"warning\", + \"session.subagent.started\", \"session.subagent.completed\", \"session.subagent.aborted\", + \"session.avatar.connecting\", \"session.avatar.switch_to_speaking\", + \"session.avatar.switch_to_idle\", \"rtc.call.sdp.created\", \"rtc.call.error\", + \"response.audio_timestamp.delta\", \"response.audio_timestamp.done\", + \"response.animation_blendshapes.delta\", \"response.animation_blendshapes.done\", + \"response.animation_viseme.delta\", \"response.animation_viseme.done\", and + \"response.video.delta\".""" @overload def __init__( self, *, - event_id: str, - response_id: str, - item_id: str, - output_index: int, - arguments: str, + type: str, ) -> None: ... @overload @@ -24500,41 +24241,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE # type: ignore -class RealtimeServerEventResponseMCPCallCompleted( - RealtimeServerEvent, discriminator="response.mcp_call.completed" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an MCP tool call has completed successfully. +class RealtimeServerEventConversationItemAdded( + RealtimeServerEvent, discriminator="conversation.item.added" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Sent by the server when an Item is added to the default Conversation. This can happen in + several cases: + + * When the client sends a `conversation.item.create` event. + * When the input audio buffer is committed. In this case the item will be a user message containing the audio from + the buffer. + * When the model is generating a Response. In this case the `conversation.item.added` event will be sent when the + model starts generating a specific Item, and thus it will not yet have any content (and `status` will be + `in_progress`). The event will include the full content of the Item (except when model is generating a Response) + except for audio data, which can be retrieved separately with a `conversation.item.retrieve` event if necessary. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call.completed``. Required. - RESPONSE_MCP_CALL_COMPLETED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_COMPLETED - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str + :ivar type: The event type, must be ``conversation.item.added``. Required. + CONVERSATION_ITEM_ADDED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_ADDED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.added``. Required. CONVERSATION_ITEM_ADDED.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, event_id: str, - output_index: int, - item_id: str, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -24546,41 +24294,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_ADDED # type: ignore -class RealtimeServerEventResponseMCPCallFailed( - RealtimeServerEvent, discriminator="response.mcp_call.failed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when an MCP tool call has failed. +class RealtimeServerEventConversationItemCreated( + RealtimeServerEvent, discriminator="conversation.item.created" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a conversation item is created. There are several scenarios that produce this + event: + + * The server is generating a Response, which if successful will produce either one or two Items, which will be of + type `message` (role `assistant`) or type `function_call`. + * The input audio buffer has been committed, either by the client or the server (in `server_vad` mode). The server + will take the content of the input audio buffer and add it to a new user message Item. + * The client has sent a `conversation.item.create` event to add a new Item to the Conversation. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call.failed``. Required. - RESPONSE_MCP_CALL_FAILED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_FAILED - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar item_id: The ID of the MCP tool call item. Required. - :vartype item_id: str + :ivar type: The event type, must be ``conversation.item.created``. Required. + CONVERSATION_ITEM_CREATED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_CREATED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, event_id: str, - output_index: int, - item_id: str, + item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -24592,41 +24346,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_CREATED # type: ignore -class RealtimeServerEventResponseMCPCallInProgress( - RealtimeServerEvent, discriminator="response.mcp_call.in_progress" +class RealtimeServerEventConversationItemDeleted( + RealtimeServerEvent, discriminator="conversation.item.deleted" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an MCP tool call has started and is in progress. + """Returned when an item in the conversation is deleted by the client with a + ``conversation.item.delete`` event. This event is used to synchronize the server's + understanding of the conversation history with the client's view. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.mcp_call.in_progress``. Required. - RESPONSE_MCP_CALL_IN_PROGRESS. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_IN_PROGRESS - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar item_id: The ID of the MCP tool call item. Required. + :ivar type: The event type, must be ``conversation.item.deleted``. Required. + CONVERSATION_ITEM_DELETED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DELETED + :ivar item_id: The ID of the item that was deleted. Required. :vartype item_id: str """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.mcp_call.in_progress``. Required. - RESPONSE_MCP_CALL_IN_PROGRESS.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the MCP tool call item. Required.""" + """The ID of the item that was deleted. Required.""" @overload def __init__( self, *, event_id: str, - output_index: int, item_id: str, ) -> None: ... @@ -24639,35 +24389,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_DELETED # type: ignore -class RealtimeServerEventResponseOutputItemAdded( - RealtimeServerEvent, discriminator="response.output_item.added" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when a new Item is created during Response generation. +class RealtimeServerEventConversationItemDone( + RealtimeServerEvent, discriminator="conversation.item.done" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a conversation item is finalized. The event will include the full content of the + Item except for audio data, which can be retrieved separately with a + ``conversation.item.retrieve`` event if needed. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.output_item.added``. Required. - RESPONSE_OUTPUT_ITEM_ADDED. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_ADDED - :ivar response_id: The ID of the Response to which the item belongs. Required. - :vartype response_id: str - :ivar output_index: The index of the output item in the Response. Required. - :vartype output_index: int + :ivar type: The event type, must be ``conversation.item.done``. Required. + CONVERSATION_ITEM_DONE. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_DONE + :ivar previous_item_id: + :vartype previous_item_id: str :ivar item: Required. :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Response to which the item belongs. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the Response. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.done``. Required. CONVERSATION_ITEM_DONE.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @@ -24676,9 +24423,8 @@ def __init__( self, *, event_id: str, - response_id: str, - output_index: int, item: "_models.RealtimeConversationItem", + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -24690,47 +24436,88 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_DONE # type: ignore -class RealtimeServerEventResponseOutputItemDone( - RealtimeServerEvent, discriminator="response.output_item.done" +class RealtimeServerEventConversationItemInputAudioTranscriptionCompleted( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.completed" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Returned when an Item is done streaming. Also emitted when a Response is interrupted, - incomplete, or cancelled. + """This event is the output of audio transcription for user audio written to the user audio + buffer. Transcription begins when the input audio buffer is committed by the client or server + (when VAD is enabled). Transcription runs asynchronously with Response creation, so this event + may come before or after the Response events. Realtime API models accept audio natively, and + thus input transcription is a separate process run on a separate ASR (Automatic Speech + Recognition) model. The transcript may diverge somewhat from the model's interpretation, and + should be treated as a rough guide. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.output_item.done``. Required. - RESPONSE_OUTPUT_ITEM_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_DONE - :ivar response_id: The ID of the Response to which the item belongs. Required. - :vartype response_id: str - :ivar output_index: The index of the output item in the Response. Required. - :vartype output_index: int - :ivar item: Required. - :vartype item: ~azure.ai.projects.models.RealtimeConversationItem + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.completed``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED + :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. + :vartype item_id: str + :ivar content_index: The index of the content part containing the audio. Required. + :vartype content_index: int + :ivar transcript: The transcribed text. Required. + :vartype transcript: str + :ivar languages: The languages detected in the audio. Returned by ``gpt-transcribe``. An empty + array indicates that no language could be reliably detected. + :vartype languages: list[~azure.ai.projects.models.TranscriptionLanguage] + :ivar logprobs: + :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] + :ivar usage: Usage statistics for the transcription, this is billed according to the ASR + model's pricing rather than the realtime model's pricing. Required. Is either a + TranscriptTextUsageTokens type or a TranscriptTextUsageDuration type. + :vartype usage: ~azure.ai.projects.models.TranscriptTextUsageTokens or + ~azure.ai.projects.models.TranscriptTextUsageDuration + :ivar phrases: Phrase-level transcription timing and confidence details. + :vartype phrases: list[~azure.ai.projects.models.VoiceAgentTranscriptionPhrase] """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Response to which the item belongs. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the Response. Required.""" - item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part containing the audio. Required.""" + transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcribed text. Required.""" + languages: Optional[list["_models.TranscriptionLanguage"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The languages detected in the audio. Returned by ``gpt-transcribe``. An empty array indicates + that no language could be reliably detected.""" + logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the transcription, this is billed according to the ASR model's pricing + rather than the realtime model's pricing. Required. Is either a TranscriptTextUsageTokens type + or a TranscriptTextUsageDuration type.""" + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Phrase-level transcription timing and confidence details.""" @overload def __init__( self, *, event_id: str, - response_id: str, - output_index: int, - item: "_models.RealtimeConversationItem", + item_id: str, + content_index: int, + transcript: str, + usage: Union["_models.TranscriptTextUsageTokens", "_models.TranscriptTextUsageDuration"], + languages: Optional[list["_models.TranscriptionLanguage"]] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = None, + phrases: Optional[list["_models.VoiceAgentTranscriptionPhrase"]] = None, ) -> None: ... @overload @@ -24742,56 +24529,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED # type: ignore -class RealtimeServerEventResponseTextDelta( - RealtimeServerEvent, discriminator="response.output_text.delta" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the text value of an "output_text" content part is updated. +class RealtimeServerEventConversationItemInputAudioTranscriptionDelta( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the text value of an input audio transcription content part is updated with + incremental transcription results. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.output_text.delta``. Required. - RESPONSE_OUTPUT_TEXT_DELTA. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.delta``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA + :ivar item_id: The ID of the item containing the audio that is being transcribed. Required. :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. + :ivar content_index: The index of the content part in the item's content array. :vartype content_index: int - :ivar delta: The text delta. Required. + :ivar delta: The text delta. :vartype delta: str + :ivar logprobs: + :vartype logprobs: list[~azure.ai.projects.models.LogProbProperties] """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta. Required.""" + """The ID of the item containing the audio that is being transcribed. Required.""" + content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array.""" + delta: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta.""" + logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, event_id: str, - response_id: str, item_id: str, - output_index: int, - content_index: int, - delta: str, + content_index: Optional[int] = None, + delta: Optional[str] = None, + logprobs: Optional[list["_models.LogProbProperties"]] = None, ) -> None: ... @overload @@ -24803,57 +24589,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA # type: ignore -class RealtimeServerEventResponseTextDone( - RealtimeServerEvent, discriminator="response.output_text.done" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when the text value of an "output_text" content part is done streaming. Also emitted - when a Response is interrupted, incomplete, or cancelled. +class RealtimeServerEventConversationItemInputAudioTranscriptionFailed( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.failed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when input audio transcription is configured, and a transcription request for a user + message failed. These events are separate from other ``error`` events so that the client can + identify the related Item. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``response.output_text.done``. Required. - RESPONSE_OUTPUT_TEXT_DONE. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.failed``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED + :ivar item_id: The ID of the user message item. Required. :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. + :ivar content_index: The index of the content part containing the audio. Required. :vartype content_index: int - :ivar text: The final text content. Required. - :vartype text: str + :ivar error: Details of the transcription error. Required. + :vartype error: + ~azure.ai.projects.models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" + """The ID of the user message item. Required.""" content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final text content. Required.""" + """The index of the content part containing the audio. Required.""" + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the transcription error. Required.""" @overload def __init__( self, *, event_id: str, - response_id: str, item_id: str, - output_index: int, content_index: int, - text: str, + error: "_models.RealtimeServerEventConversationItemInputAudioTranscriptionFailedError", ) -> None: ... @overload @@ -24865,47 +24647,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED # type: ignore -class RealtimeServerEventSessionCreated( - RealtimeServerEvent, discriminator="session.created" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a Session is created. Emitted automatically when a new connection is established - as the first server event. This event will contain the default Session configuration. +class RealtimeServerEventConversationItemInputAudioTranscriptionFailedError( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventConversationItemInputAudioTranscriptionFailedError. - :ivar event_id: The unique ID of the server event. Required. - :vartype event_id: str - :ivar type: The event type, must be ``session.created``. Required. SESSION_CREATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_CREATED - :ivar session: The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig - :ivar conversation_id: The session-scoped conversation id. When present, responses attached to - the session conversation use the same value in ``response.created`` and ``response.done``. - :vartype conversation_id: str + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str + :ivar param: + :vartype param: str """ - event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.SESSION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - session: "_unions.VoiceAgentSessionResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session-scoped conversation id. When present, responses attached to the session - conversation use the same value in ``response.created`` and ``response.done``.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - event_id: str, - session: "_unions.VoiceAgentSessionResponse", - conversation_id: Optional[str] = None, + type: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + param: Optional[str] = None, ) -> None: ... @overload @@ -24917,39 +24689,67 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_CREATED # type: ignore -class RealtimeServerEventSessionUpdated( - RealtimeServerEvent, discriminator="session.updated" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Returned when a session is updated with a ``session.update`` event, unless there is an error. +class RealtimeServerEventConversationItemInputAudioTranscriptionSegment( + RealtimeServerEvent, discriminator="conversation.item.input_audio_transcription.segment" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an input audio transcription segment is identified for an item. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str - :ivar type: The event type, must be ``session.updated``. Required. SESSION_UPDATED. - :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED - :ivar session: The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig - :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + :ivar type: The event type, must be ``conversation.item.input_audio_transcription.segment``. + Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT. + :vartype type: str or + ~azure.ai.projects.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT + :ivar item_id: The ID of the item containing the input audio content. Required. + :vartype item_id: str + :ivar content_index: The index of the input audio content part within the item. Required. + :vartype content_index: int + :ivar text: The text for this segment. Required. + :vartype text: str + :ivar id: The segment identifier. Required. + :vartype id: str + :ivar speaker: The detected speaker label for this segment. Required. + :vartype speaker: str + :ivar start: Start time of the segment in seconds. Required. + :vartype start: float + :ivar end: End time of the segment in seconds. Required. + :vartype end: float """ event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the server event. Required.""" - type: Literal[RealtimeServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: "_unions.VoiceAgentSessionResponse" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The session configuration. Required. Is one of the following types: - VoiceAgentSessionResponseConfig""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.input_audio_transcription.segment``. Required. + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item containing the input audio content. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the input audio content part within the item. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text for this segment. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The segment identifier. Required.""" + speaker: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detected speaker label for this segment. Required.""" + start: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Start time of the segment in seconds. Required.""" + end: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """End time of the segment in seconds. Required.""" @overload def __init__( self, *, event_id: str, - session: "_unions.VoiceAgentSessionResponse", + item_id: str, + content_index: int, + text: str, + id: str, # pylint: disable=redefined-builtin + speaker: str, + start: float, + end: float, ) -> None: ... @overload @@ -24961,60 +24761,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RealtimeServerEventType.SESSION_UPDATED # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT # type: ignore -class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reasoning. +class RealtimeServerEventConversationItemRetrieved( + RealtimeServerEvent, discriminator="conversation.item.retrieved" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a conversation item is retrieved with ``conversation.item.retrieve``. This is + provided as a way to fetch the server's representation of an item, for example to get access to + the post-processed audio data after noise cancellation and VAD. It includes the full content of + the Item, including audio data. - :ivar mode: Controls the reasoning execution mode for the request. When returned on a response, - this is the effective execution mode. Known values are: "standard" and "pro". - :vartype mode: str or ~azure.ai.projects.models.ReasoningModeEnum - :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", "xhigh", and "max". - :vartype effort: str or ~azure.ai.projects.models.ReasoningEffort - :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype summary: str or str or str - :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], - Literal["all_turns"] - :vartype context: str or str or str - :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], - Literal["detailed"] - :vartype generate_summary: str or str or str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.retrieved``. Required. + CONVERSATION_ITEM_RETRIEVED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_RETRIEVED + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ - mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls the reasoning execution mode for the request. When returned on a response, this is the - effective execution mode. Known values are: \"standard\" and \"pro\".""" - effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", and \"max\".""" - summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" - context: Optional[Literal["auto", "current_turn", "all_turns"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], - Literal[\"all_turns\"]""" - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = None, - effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, - summary: Optional[Literal["auto", "concise", "detailed"]] = None, - context: Optional[Literal["auto", "current_turn", "all_turns"]] = None, - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None, + event_id: str, + item: "_models.RealtimeConversationItem", ) -> None: ... @overload @@ -25026,53 +24805,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.CONVERSATION_ITEM_RETRIEVED # type: ignore -class RecurrenceTrigger( - Trigger, discriminator="Recurrence" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Recurrence based trigger. +class RealtimeServerEventConversationItemTruncated( + RealtimeServerEvent, discriminator="conversation.item.truncated" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an earlier assistant audio message item is truncated by the client with a + ``conversation.item.truncate`` event. This event is used to synchronize the server's + understanding of the audio with the client's playback. This action will truncate the audio and + remove the server-side text transcript to ensure there is no text in the context that hasn't + been heard by the user. - :ivar type: Type of the trigger. Required. Recurrence based trigger. - :vartype type: str or ~azure.ai.projects.models.RECURRENCE - :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar end_time: End time for the recurrence schedule in ISO 8601 format. - :vartype end_time: ~datetime.datetime - :ivar time_zone: Time zone for the recurrence schedule. Defaults to ``UTC``. - :vartype time_zone: str - :ivar interval: Interval for the recurrence schedule. Required. - :vartype interval: int - :ivar schedule: Recurrence schedule for the recurrence trigger. Required. - :vartype schedule: ~azure.ai.projects.models.RecurrenceSchedule + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``conversation.item.truncated``. Required. + CONVERSATION_ITEM_TRUNCATED. + :vartype type: str or ~azure.ai.projects.models.CONVERSATION_ITEM_TRUNCATED + :ivar item_id: The ID of the assistant message item that was truncated. Required. + :vartype item_id: str + :ivar content_index: The index of the content part that was truncated. Required. + :vartype content_index: int + :ivar audio_end_ms: The duration up to which the audio was truncated, in milliseconds. + Required. + :vartype audio_end_ms: int + :ivar item: The assistant message after truncation, when the service returns the updated item. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ - type: Literal[TriggerType.RECURRENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of the trigger. Required. Recurrence based trigger.""" - start_time: Optional[datetime.datetime] = rest_field( - name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Start time for the recurrence schedule in ISO 8601 format.""" - end_time: Optional[datetime.datetime] = rest_field( - name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the assistant message item that was truncated. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that was truncated. Required.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The duration up to which the audio was truncated, in milliseconds. Required.""" + item: Optional["_models.RealtimeConversationItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """End time for the recurrence schedule in ISO 8601 format.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the recurrence schedule. Defaults to ``UTC``.""" - interval: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Interval for the recurrence schedule. Required.""" - schedule: "_models.RecurrenceSchedule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Recurrence schedule for the recurrence trigger. Required.""" + """The assistant message after truncation, when the service returns the updated item.""" @overload def __init__( self, *, - interval: int, - schedule: "_models.RecurrenceSchedule", - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - time_zone: Optional[str] = None, + event_id: str, + item_id: str, + content_index: int, + audio_end_ms: int, + item: Optional["_models.RealtimeConversationItem"] = None, ) -> None: ... @overload @@ -25084,88 +24868,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.RECURRENCE # type: ignore + self.type = RealtimeServerEventType.CONVERSATION_ITEM_TRUNCATED # type: ignore -class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Red team details. +class RealtimeServerEventError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when an error occurs, which could be a client problem or a server problem. Most errors + are recoverable and the session will stay open, we recommend to implementors to monitor and log + error messages by default. - :ivar name: Identifier of the red team run. Required. - :vartype name: str - :ivar display_name: Name of the red-team run. - :vartype display_name: str - :ivar num_turns: Number of simulation rounds. - :vartype num_turns: int - :ivar attack_strategies: List of attack strategies or nested lists of attack strategies. - :vartype attack_strategies: list[str or ~azure.ai.projects.models.AttackStrategy] - :ivar simulation_only: Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs - conversation not evaluation result. The service defaults to ``false`` if a value is not - specified by the caller. - :vartype simulation_only: bool - :ivar risk_categories: List of risk categories to generate attack objectives for. - :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] - :ivar application_scenario: Application scenario for the red team operation, to generate - scenario specific attacks. - :vartype application_scenario: str - :ivar tags: Red team's tags. Unlike properties, tags are fully mutable. - :vartype tags: dict[str, str] - :ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a - property cannot be removed. - :vartype properties: dict[str, str] - :ivar status: Status of the red-team. It is set by service and is read-only. - :vartype status: str - :ivar target: Target configuration for the red-team run. Required. - :vartype target: ~azure.ai.projects.models.RedTeamTargetConfig + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``error``. Required. Default value is "error". + :vartype type: str + :ivar error: Details of the error. Required. + :vartype error: ~azure.ai.projects.models.RealtimeServerEventErrorError """ - name: str = rest_field(name="id", visibility=["read"]) - """Identifier of the red team run. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the red-team run.""" - num_turns: Optional[int] = rest_field(name="numTurns", visibility=["read", "create", "update", "delete", "query"]) - """Number of simulation rounds.""" - attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = rest_field( - name="attackStrategies", visibility=["read", "create", "update", "delete", "query"] - ) - """List of attack strategies or nested lists of attack strategies.""" - simulation_only: Optional[bool] = rest_field( - name="simulationOnly", visibility=["read", "create", "update", "delete", "query"] - ) - """Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs conversation not - evaluation result. The service defaults to ``false`` if a value is not specified by the caller.""" - risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = rest_field( - name="riskCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of risk categories to generate attack objectives for.""" - application_scenario: Optional[str] = rest_field( - name="applicationScenario", visibility=["read", "create", "update", "delete", "query"] + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event type, must be ``error``. Required. Default value is \"error\".""" + error: "_models.RealtimeServerEventErrorError" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Application scenario for the red team operation, to generate scenario specific attacks.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Red team's tags. Unlike properties, tags are fully mutable.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be - removed.""" - status: Optional[str] = rest_field(visibility=["read"]) - """Status of the red-team. It is set by service and is read-only.""" - target: "_models.RedTeamTargetConfig" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target configuration for the red-team run. Required.""" + """Details of the error. Required.""" @overload def __init__( self, *, - target: "_models.RedTeamTargetConfig", - display_name: Optional[str] = None, - num_turns: Optional[int] = None, - attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = None, - simulation_only: Optional[bool] = None, - risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = None, - application_scenario: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, + event_id: str, + error: "_models.RealtimeServerEventErrorError", ) -> None: ... @overload @@ -25177,60 +24910,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["error"] = "error" -class ReinforcementFineTuningDataGenerationJob( - DataGenerationJob, discriminator="reinforcement_finetuning_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Reinforcement fine-tuning data generation job resource. This is a preview feature. +class RealtimeServerEventErrorError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """RealtimeServerEventErrorError. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.DataGenerationJobResult - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: str or ~azure.ai.projects.models.JobStatus - :ivar error: Error details — populated only on failure. - :vartype error: ~azure.ai.projects.models.ApiError - :ivar name: The display name of the data generation job. Required. - :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds - since January 1, 1970). Required. - :vartype created_at: ~datetime.datetime - :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds - since January 1, 1970). - :vartype finished_at: ~datetime.datetime - :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning - preview for this model. Required. Reinforcement Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated reinforcement - fine-tuning data. - :vartype output_configuration: - ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration + :ivar type: Required. + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar event_id: + :vartype event_id: str """ - scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this - model. Required. Reinforcement Fine-tuning preview scenario.""" - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional file output configuration for the generated reinforcement fine-tuning data.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, + event_id: Optional[str] = None, ) -> None: ... @overload @@ -25242,47 +24956,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore -class ReinforcementFineTuningDataGenerationJobInputs( - DataGenerationJobInputs, discriminator="reinforcement_finetuning_preview" +class RealtimeServerEventInputAudioBufferCleared( + RealtimeServerEvent, discriminator="input_audio_buffer.cleared" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for a reinforcement fine-tuning data generation job. This is a preview - feature. + """Returned when the input audio buffer is cleared by the client with a + ``input_audio_buffer.clear`` event. - :ivar name: The display name of the data generation job. Required. - :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning - preview for this model. Required. Reinforcement Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated reinforcement - fine-tuning data. - :vartype output_configuration: - ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.cleared``. Required. + INPUT_AUDIO_BUFFER_CLEARED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_CLEARED """ - scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this - model. Required. Reinforcement Fine-tuning preview scenario.""" - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional file output configuration for the generated reinforcement fine-tuning data.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" @overload def __init__( self, *, - name: str, - sources: list["_models.DataGenerationJobSource"], - generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, + event_id: str, ) -> None: ... @overload @@ -25294,42 +24992,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_CLEARED # type: ignore -class ReinforcementFineTuningDataGenerationJobOutputConfiguration( - _Model +class RealtimeServerEventInputAudioBufferCommitted( + RealtimeServerEvent, discriminator="input_audio_buffer.committed" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """File output configuration for a reinforcement fine-tuning data generation job. This is a - preview feature. + """Returned when an input audio buffer is committed, either by the client or automatically in + server VAD mode. The ``item_id`` property is the ID of the user message item that will be + created, thus a ``conversation.item.created`` event will also be sent to the client. - :ivar name: Filename to assign to the generated fine-tuning file. Required. - :vartype name: str - :ivar write_mode: Controls how file outputs are written. If omitted, defaults to ``overwrite`` - and writes only the newly generated fine-tuning file content. Known values are: "overwrite" and - "merge". - :vartype write_mode: str or ~azure.ai.projects.models.DataGenerationJobOutputWriteMode - :ivar merge_file_id: File ID to merge into when ``write_mode`` is ``merge``. - :vartype merge_file_id: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.committed``. Required. + INPUT_AUDIO_BUFFER_COMMITTED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_COMMITTED + :ivar previous_item_id: + :vartype previous_item_id: str + :ivar item_id: The ID of the user message item that will be created. Required. + :vartype item_id: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filename to assign to the generated fine-tuning file. Required.""" - write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Controls how file outputs are written. If omitted, defaults to ``overwrite`` and writes only - the newly generated fine-tuning file content. Known values are: \"overwrite\" and \"merge\".""" - merge_file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File ID to merge into when ``write_mode`` is ``merge``.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.committed``. Required. + INPUT_AUDIO_BUFFER_COMMITTED.""" + previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item that will be created. Required.""" @overload def __init__( self, *, - name: str, - write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = None, - merge_file_id: Optional[str] = None, + event_id: str, + item_id: str, + previous_item_id: Optional[str] = None, ) -> None: ... @overload @@ -25341,35 +25040,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_COMMITTED # type: ignore -class ReminderPreviewToolboxTool( - ToolboxTool, discriminator="reminder_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reminder tool stored in a toolbox. +class RealtimeServerEventInputAudioBufferSpeechStarted( + RealtimeServerEvent, discriminator="input_audio_buffer.speech_started" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Sent by the server when in ``server_vad`` mode to indicate that speech has been detected in the + audio buffer. This can happen any time audio is added to the buffer (unless speech is already + detected). The client may want to use this event to interrupt audio playback or provide visual + feedback to the user. The client should expect to receive a + ``input_audio_buffer.speech_stopped`` event when speech stops. The ``item_id`` property is the + ID of the user message item that will be created when speech stops and will also be included in + the ``input_audio_buffer.speech_stopped`` event (unless the client manually commits the audio + buffer during VAD activation). - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: Required. REMINDER_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.REMINDER_PREVIEW + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.speech_started``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STARTED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STARTED + :ivar audio_start_ms: Milliseconds from the start of all audio written to the buffer during the + session when speech was first detected. This will correspond to the beginning of audio sent to + the model, and thus includes the ``prefix_padding_ms`` configured in the Session. Required. + :vartype audio_start_ms: int + :ivar item_id: The ID of the user message item that will be created when speech stops. + Required. + :vartype item_id: str """ - type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. REMINDER_PREVIEW.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.speech_started``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" + audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Milliseconds from the start of all audio written to the buffer during the session when speech + was first detected. This will correspond to the beginning of audio sent to the model, and thus + includes the ``prefix_padding_ms`` configured in the Session. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item that will be created when speech stops. Required.""" @overload def __init__( self, *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + event_id: str, + audio_start_ms: int, + item_id: str, ) -> None: ... @overload @@ -25381,33 +25099,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.REMINDER_PREVIEW # type: ignore - - -class ResponsesProtocolConfiguration(_Model): - """Configuration specific to the responses protocol.""" + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED # type: ignore -class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageInputTokensDetails. +class RealtimeServerEventInputAudioBufferSpeechStopped( + RealtimeServerEvent, discriminator="input_audio_buffer.speech_stopped" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned in ``server_vad`` mode when the server detects the end of speech in the audio buffer. + The server will also send an ``conversation.item.created`` event with the user message item + that is created from the audio buffer. - :ivar cached_tokens: Required. - :vartype cached_tokens: int - :ivar cache_write_tokens: Required. - :vartype cache_write_tokens: int + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.speech_stopped``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STOPPED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_SPEECH_STOPPED + :ivar audio_end_ms: Milliseconds since the session started when speech stopped. This will + correspond to the end of audio sent to the model, and thus includes the + ``min_silence_duration_ms`` configured in the Session. Required. + :vartype audio_end_ms: int + :ivar item_id: The ID of the user message item that will be created. Required. + :vartype item_id: str """ - cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - cache_write_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.speech_stopped``. Required. + INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Milliseconds since the session started when speech stopped. This will correspond to the end of + audio sent to the model, and thus includes the ``min_silence_duration_ms`` configured in the + Session. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the user message item that will be created. Required.""" @overload def __init__( self, *, - cached_tokens: int, - cache_write_tokens: int, + event_id: str, + audio_end_ms: int, + item_id: str, ) -> None: ... @overload @@ -25419,23 +25152,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED # type: ignore -class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ResponseUsageOutputTokensDetails. +class RealtimeServerEventInputAudioBufferTimeoutTriggered( + RealtimeServerEvent, discriminator="input_audio_buffer.timeout_triggered" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the Server VAD timeout is triggered for the input audio buffer. This is + configured with ``idle_timeout_ms`` in the ``turn_detection`` settings of the session, and it + indicates that there hasn't been any speech detected for the configured duration. The + ``audio_start_ms`` and ``audio_end_ms`` fields indicate the segment of audio after the last + model response up to the triggering time, as an offset from the beginning of audio written to + the input audio buffer. This means it demarcates the segment of audio that was silent and the + difference between the start and end values will roughly match the configured timeout. The + empty audio will be committed to the conversation as an ``input_audio`` item (there will be a + ``input_audio_buffer.committed`` event) and a model response will be generated. There may be + speech that didn't trigger VAD but is still detected by the model, so the model may respond + with something relevant to the conversation or a prompt to continue speaking. - :ivar reasoning_tokens: Required. - :vartype reasoning_tokens: int + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``input_audio_buffer.timeout_triggered``. Required. + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED. + :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED + :ivar audio_start_ms: Millisecond offset of audio written to the input audio buffer that was + after the playback time of the last model response. Required. + :vartype audio_start_ms: int + :ivar audio_end_ms: Millisecond offset of audio written to the input audio buffer at the time + the timeout was triggered. Required. + :vartype audio_end_ms: int + :ivar item_id: The ID of the item associated with this segment. Required. + :vartype item_id: str """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_audio_buffer.timeout_triggered``. Required. + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Millisecond offset of audio written to the input audio buffer that was after the playback time + of the last model response. Required.""" + audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Millisecond offset of audio written to the input audio buffer at the time the timeout was + triggered. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item associated with this segment. Required.""" @overload def __init__( self, *, - reasoning_tokens: int, + event_id: str, + audio_start_ms: int, + audio_end_ms: int, + item_id: str, ) -> None: ... @overload @@ -25447,59 +25218,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED # type: ignore -class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A routine definition returned by the service. +class RealtimeServerEventMCPListToolsCompleted( + RealtimeServerEvent, discriminator="mcp_list_tools.completed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when listing MCP tools has completed for an item. - :ivar name: The routine name. - :vartype name: str - :ivar description: A human-readable description of the routine. - :vartype description: str - :ivar enabled: Whether the routine is enabled. Required. - :vartype enabled: bool - :ivar triggers: The triggers configured for the routine. - :vartype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] - :ivar action: The action executed when the routine fires. - :vartype action: ~azure.ai.projects.models.RoutineAction - :ivar created_at: The time when the routine was created. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The time when the routine was last updated. - :vartype updated_at: ~datetime.datetime + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``mcp_list_tools.completed``. Required. + MCP_LIST_TOOLS_COMPLETED. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_COMPLETED + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The routine name.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the routine.""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the routine is enabled. Required.""" - triggers: Optional[dict[str, "_models.RoutineTrigger"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The triggers configured for the routine.""" - action: Optional["_models.RoutineAction"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The action executed when the routine fires.""" - created_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the routine was created.""" - updated_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the routine was last updated.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``mcp_list_tools.completed``. Required. MCP_LIST_TOOLS_COMPLETED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP list tools item. Required.""" @overload def __init__( self, *, - enabled: bool, - name: Optional[str] = None, - description: Optional[str] = None, - triggers: Optional[dict[str, "_models.RoutineTrigger"]] = None, - action: Optional["_models.RoutineAction"] = None, - created_at: Optional[datetime.datetime] = None, - updated_at: Optional[datetime.datetime] = None, + event_id: str, + item_id: str, ) -> None: ... @overload @@ -25511,29 +25259,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.MCP_LIST_TOOLS_COMPLETED # type: ignore -class RoutineAuthorization(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Optional authorization configuration for a routine dispatch. +class RealtimeServerEventMCPListToolsFailed( + RealtimeServerEvent, discriminator="mcp_list_tools.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when listing MCP tools has failed for an item. - :ivar identity: The identity used when dispatching the routine. Defaults to agent when omitted; - set to creator only when the customer opts in to creator identity dispatch. Known values are: - "agent" and "creator". - :vartype identity: str or ~azure.ai.projects.models.RoutineDispatchIdentity + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_FAILED + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str """ - identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The identity used when dispatching the routine. Defaults to agent when omitted; set to creator - only when the customer opts in to creator identity dispatch. Known values are: \"agent\" and - \"creator\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``mcp_list_tools.failed``. Required. MCP_LIST_TOOLS_FAILED.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP list tools item. Required.""" @overload def __init__( self, *, - identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = None, + event_id: str, + item_id: str, ) -> None: ... @overload @@ -25545,164 +25299,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.MCP_LIST_TOOLS_FAILED # type: ignore -class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single routine run returned from the run history API. +class RealtimeServerEventMCPListToolsInProgress( + RealtimeServerEvent, discriminator="mcp_list_tools.in_progress" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when listing MCP tools is in progress for an item. - :ivar id: The unique run identifier for the routine attempt. Required. - :vartype id: str - :ivar status: The run status. Is one of the following types: str - :vartype status: str - :ivar phase: The AgentExtensions lifecycle phase for the routine attempt. Known values are: - "queued", "dispatching", "completed", and "failed". - :vartype phase: str or ~azure.ai.projects.models.RoutineRunPhase - :ivar trigger_type: The trigger type that produced the routine attempt. Known values are: - "custom", "github_issue", "schedule", and "timer". - :vartype trigger_type: str or ~azure.ai.projects.models.RoutineTriggerType - :ivar trigger_name: The configured trigger name that produced the routine attempt. - :vartype trigger_name: str - :ivar trigger_event_payload: The event payload captured from the event that triggered the - routine attempt, when available. - :vartype trigger_event_payload: dict[str, any] - :ivar attempt_source: The source path that created the routine attempt. Known values are: - "event_fire", "manual_dispatch", "queued_dispatch", "schedule_delivery", and "timer_delivery". - :vartype attempt_source: str or ~azure.ai.projects.models.RoutineAttemptSource - :ivar action_type: The action type dispatched for the routine attempt. Known values are: - "invoke_agent_responses_api" and "invoke_agent_invocations_api". - :vartype action_type: str or ~azure.ai.projects.models.RoutineActionType - :ivar agent_id: The project-scoped agent identifier recorded for the routine attempt. - :vartype agent_id: str - :ivar agent_endpoint_id: The legacy endpoint-scoped agent identifier recorded for the routine - attempt. - :vartype agent_endpoint_id: str - :ivar conversation_id: The conversation identifier used by a responses API dispatch. - :vartype conversation_id: str - :ivar session_id: The hosted-agent session identifier used by an invocations API dispatch. - :vartype session_id: str - :ivar triggered_at: The logical trigger time recorded for the routine attempt. - :vartype triggered_at: ~datetime.datetime - :ivar scheduled_fire_at: The scheduled fire time recorded for timer and schedule deliveries. - :vartype scheduled_fire_at: ~datetime.datetime - :ivar started_at: The time when the underlying run started. - :vartype started_at: ~datetime.datetime - :ivar ended_at: The time when the underlying run reached a terminal state. - :vartype ended_at: ~datetime.datetime - :ivar dispatch_id: The dispatch identifier associated with the routine attempt. - :vartype dispatch_id: str - :ivar action_correlation_id: The downstream action correlation identifier, when available. - :vartype action_correlation_id: str - :ivar response_id: The downstream response or invocation identifier, when available. - :vartype response_id: str - :ivar task_id: The workspace task identifier linked to the routine attempt, when available. - :vartype task_id: str - :ivar error_status_code: The downstream error status code captured for a failed attempt, when - available. - :vartype error_status_code: int - :ivar error_type: The fully qualified error type captured for a failed attempt, when available. - :vartype error_type: str - :ivar error_message: The truncated failure message captured for a failed attempt, when - available. - :vartype error_message: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``mcp_list_tools.in_progress``. Required. + MCP_LIST_TOOLS_IN_PROGRESS. + :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS_IN_PROGRESS + :ivar item_id: The ID of the MCP list tools item. Required. + :vartype item_id: str """ - id: str = rest_field(visibility=["read"]) - """The unique run identifier for the routine attempt. Required.""" - status: Optional["_unions.RoutineRunStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The run status. Is one of the following types: str""" - phase: Optional[Union[str, "_models.RoutineRunPhase"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The AgentExtensions lifecycle phase for the routine attempt. Known values are: \"queued\", - \"dispatching\", \"completed\", and \"failed\".""" - trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The trigger type that produced the routine attempt. Known values are: \"custom\", - \"github_issue\", \"schedule\", and \"timer\".""" - trigger_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The configured trigger name that produced the routine attempt.""" - trigger_event_payload: Optional[dict[str, Any]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The event payload captured from the event that triggered the routine attempt, when available.""" - attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The source path that created the routine attempt. Known values are: \"event_fire\", - \"manual_dispatch\", \"queued_dispatch\", \"schedule_delivery\", and \"timer_delivery\".""" - action_type: Optional[Union[str, "_models.RoutineActionType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The action type dispatched for the routine attempt. Known values are: - \"invoke_agent_responses_api\" and \"invoke_agent_invocations_api\".""" - agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The project-scoped agent identifier recorded for the routine attempt.""" - agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The legacy endpoint-scoped agent identifier recorded for the routine attempt.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The conversation identifier used by a responses API dispatch.""" - session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The hosted-agent session identifier used by an invocations API dispatch.""" - triggered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The logical trigger time recorded for the routine attempt.""" - scheduled_fire_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The scheduled fire time recorded for timer and schedule deliveries.""" - started_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the underlying run started.""" - ended_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The time when the underlying run reached a terminal state.""" - dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The dispatch identifier associated with the routine attempt.""" - action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The downstream action correlation identifier, when available.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The downstream response or invocation identifier, when available.""" - task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The workspace task identifier linked to the routine attempt, when available.""" - error_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The downstream error status code captured for a failed attempt, when available.""" - error_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The fully qualified error type captured for a failed attempt, when available.""" - error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The truncated failure message captured for a failed attempt, when available.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``mcp_list_tools.in_progress``. Required. MCP_LIST_TOOLS_IN_PROGRESS.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP list tools item. Required.""" @overload def __init__( self, *, - status: Optional["_unions.RoutineRunStatus"] = None, - phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, - trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, - trigger_name: Optional[str] = None, - trigger_event_payload: Optional[dict[str, Any]] = None, - attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = None, - action_type: Optional[Union[str, "_models.RoutineActionType"]] = None, - agent_id: Optional[str] = None, - agent_endpoint_id: Optional[str] = None, - conversation_id: Optional[str] = None, - session_id: Optional[str] = None, - triggered_at: Optional[datetime.datetime] = None, - scheduled_fire_at: Optional[datetime.datetime] = None, - started_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - dispatch_id: Optional[str] = None, - action_correlation_id: Optional[str] = None, - response_id: Optional[str] = None, - task_id: Optional[str] = None, - error_status_code: Optional[int] = None, - error_type: Optional[str] = None, - error_message: Optional[str] = None, + event_id: str, + item_id: str, ) -> None: ... @overload @@ -25714,63 +25340,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.MCP_LIST_TOOLS_IN_PROGRESS # type: ignore -class RubricBasedEvaluatorDefinition( - EvaluatorDefinition, discriminator="rubric" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for - both quality and safety evaluators. +class RealtimeServerEventOutputAudioBufferCleared( + RealtimeServerEvent, discriminator="output_audio_buffer.cleared" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """**WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This happens either in + VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the + client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current + audio response. `Learn more + `_. - :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. - This includes parameters like type, properties, required. - :vartype init_parameters: dict[str, any] - :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This - includes parameters like type, properties, required. - :vartype data_schema: dict[str, any] - :ivar metrics: List of output metrics produced by this evaluator. - :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] - :ivar type: Required. Rubric-based evaluator definition. Stores dimensions (the scoring - blueprint) for both quality and safety evaluators. Can be created via the generate API or - manually via createVersion. - :vartype type: str or ~azure.ai.projects.models.RUBRIC - :ivar dimensions: The set of dimensions — the scoring blueprint used by the LLM judge. Quality - evaluators include a non-editable residual dimension with id 'general_quality' - (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the - same Dimension structure. Required. - :vartype dimensions: list[~azure.ai.projects.models.Dimension] - :ivar pass_threshold: Pass/fail threshold for the aggregate rubric score, on the same - normalized 0.0-1.0 scale as the emitted ``score``. When the runtime weighted average meets or - exceeds this value, the result is ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted - average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this - threshold. - :vartype pass_threshold: float + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``output_audio_buffer.cleared``. Required. + OUTPUT_AUDIO_BUFFER_CLEARED. + :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO_BUFFER_CLEARED + :ivar response_id: The unique ID of the response that produced the audio. Required. + :vartype response_id: str """ - type: Literal[EvaluatorDefinitionType.RUBRIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Rubric-based evaluator definition. Stores dimensions (the scoring blueprint) for both - quality and safety evaluators. Can be created via the generate API or manually via - createVersion.""" - dimensions: list["_models.Dimension"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include - a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety - evaluators include 'general_policy_compliance'. Both use the same Dimension structure. - Required.""" - pass_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the - emitted ``score``. When the runtime weighted average meets or exceeds this value, the result is - ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension - scored 1 → fail' rule still applies regardless of this threshold.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``output_audio_buffer.cleared``. Required. OUTPUT_AUDIO_BUFFER_CLEARED.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response that produced the audio. Required.""" @overload def __init__( self, *, - dimensions: list["_models.Dimension"], - init_parameters: Optional[dict[str, Any]] = None, - data_schema: Optional[dict[str, Any]] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, - pass_threshold: Optional[float] = None, + event_id: str, + response_id: str, ) -> None: ... @overload @@ -25782,66 +25385,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.RUBRIC # type: ignore + self.type = RealtimeServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore -class RubricGenerationInputQualityWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A non-fatal advisory produced during rubric evaluator generation when resolved inputs are - technically valid but likely too weak to produce a high-quality rubric. Read-only; - service-generated. Persisted with the terminal EvaluatorGenerationJob. +class RealtimeServerEventRateLimitsUpdated( + RealtimeServerEvent, discriminator="rate_limits.updated" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is + created some tokens will be "reserved" for the output tokens, the rate limits shown here + reflect that reservation, which is then adjusted accordingly once the Response is completed. - :ivar code: Stable searchable machine-readable warning code. Required. Known values are: - "empty_prompt", "short_prompt", "empty_agent_instructions", "short_agent_instructions", - "empty_dataset_content", "short_dataset_content", "low_trace_count", and - "insufficient_total_input". - :vartype code: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningCode - :ivar severity: Advisory severity. Initial values: ``warning``. Required. "warning" - :vartype severity: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity - :ivar message: Human-readable message suitable for direct SDK/CLI/UI display. Must not include - raw prompt, instruction, dataset, or trace text. Required. - :vartype message: str - :ivar source: Which source category the warning applies to. ``aggregate`` is used only for - cross-source warnings. Required. Known values are: "prompt", "agent", "dataset", and - "aggregate". - :vartype source: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSource - :ivar source_index: Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning - applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one - source. - :vartype source_index: int + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED. + :vartype type: str or ~azure.ai.projects.models.RATE_LIMITS_UPDATED + :ivar rate_limits: List of rate limit information. Required. + :vartype rate_limits: + list[~azure.ai.projects.models.RealtimeServerEventRateLimitsUpdatedRateLimits] """ - code: Union[str, "_models.RubricGenerationInputQualityWarningCode"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Stable searchable machine-readable warning code. Required. Known values are: \"empty_prompt\", - \"short_prompt\", \"empty_agent_instructions\", \"short_agent_instructions\", - \"empty_dataset_content\", \"short_dataset_content\", \"low_trace_count\", and - \"insufficient_total_input\".""" - severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Advisory severity. Initial values: ``warning``. Required. \"warning\"""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, - instruction, dataset, or trace text. Required.""" - source: Union[str, "_models.RubricGenerationInputQualityWarningSource"] = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RATE_LIMITS_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``rate_limits.updated``. Required. RATE_LIMITS_UPDATED.""" + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Which source category the warning applies to. ``aggregate`` is used only for cross-source - warnings. Required. Known values are: \"prompt\", \"agent\", \"dataset\", and \"aggregate\".""" - source_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning applies to a specific - source. Omitted for aggregate warnings and for warnings not tied to one source.""" + """List of rate limit information. Required.""" @overload def __init__( self, *, - code: Union[str, "_models.RubricGenerationInputQualityWarningCode"], - severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"], - message: str, - source: Union[str, "_models.RubricGenerationInputQualityWarningSource"], - source_index: Optional[int] = None, + event_id: str, + rate_limits: list["_models.RealtimeServerEventRateLimitsUpdatedRateLimits"], ) -> None: ... @overload @@ -25853,25 +25430,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RATE_LIMITS_UPDATED # type: ignore -class SASCredentials(BaseCredentials, discriminator="SAS"): - """Shared Access Signature (SAS) credential definition. +class RealtimeServerEventRateLimitsUpdatedRateLimits( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventRateLimitsUpdatedRateLimits. - :ivar type: The credential type. Required. Shared Access Signature (SAS) credential. - :vartype type: str or ~azure.ai.projects.models.SAS - :ivar sas_token: SAS token. - :vartype sas_token: str + :ivar name: Is either a Literal["requests"] type or a Literal["tokens"] type. + :vartype name: str or str + :ivar limit: + :vartype limit: int + :ivar remaining: + :vartype remaining: int + :ivar reset_seconds: + :vartype reset_seconds: float """ - type: Literal[CredentialType.SAS] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Shared Access Signature (SAS) credential.""" - sas_token: Optional[str] = rest_field(name="SAS", visibility=["read"]) - """SAS token.""" + name: Optional[Literal["requests", "tokens"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"requests\"] type or a Literal[\"tokens\"] type.""" + limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + remaining: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + reset_seconds: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + name: Optional[Literal["requests", "tokens"]] = None, + limit: Optional[int] = None, + remaining: Optional[int] = None, + reset_seconds: Optional[float] = None, ) -> None: ... @overload @@ -25883,74 +25475,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.SAS # type: ignore -class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule model. +class RealtimeServerEventResponseAudioDelta( + RealtimeServerEvent, discriminator="response.output_audio.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the model-generated audio is updated. - :ivar schedule_id: Identifier of the schedule. Required. - :vartype schedule_id: str - :ivar display_name: Name of the schedule. - :vartype display_name: str - :ivar description: Description of the schedule. - :vartype description: str - :ivar enabled: Enabled status of the schedule. Required. - :vartype enabled: bool - :ivar provisioning_status: Provisioning status of the schedule. Known values are: "Creating", - "Updating", "Deleting", "Succeeded", and "Failed". - :vartype provisioning_status: str or ~azure.ai.projects.models.ScheduleProvisioningStatus - :ivar trigger: Trigger for the schedule. Required. - :vartype trigger: ~azure.ai.projects.models.Trigger - :ivar task: Task for the schedule. Required. - :vartype task: ~azure.ai.projects.models.ScheduleTask - :ivar tags: Schedule's tags. Unlike properties, tags are fully mutable. - :vartype tags: dict[str, str] - :ivar properties: Schedule's properties. Unlike tags, properties are add-only. Once added, a - property cannot be removed. - :vartype properties: dict[str, str] - :ivar system_data: System metadata for the resource. Required. - :vartype system_data: dict[str, str] + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio.delta``. Required. + RESPONSE_OUTPUT_AUDIO_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar delta: Base64-encoded audio data delta. Required. + :vartype delta: bytes """ - schedule_id: str = rest_field(name="id", visibility=["read"]) - """Identifier of the schedule. Required.""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the schedule.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the schedule.""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Enabled status of the schedule. Required.""" - provisioning_status: Optional[Union[str, "_models.ScheduleProvisioningStatus"]] = rest_field( - name="provisioningStatus", visibility=["read"] - ) - """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", - \"Deleting\", \"Succeeded\", and \"Failed\".""" - trigger: "_models.Trigger" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Trigger for the schedule. Required.""" - task: "_models.ScheduleTask" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Task for the schedule. Required.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Schedule's tags. Unlike properties, tags are fully mutable.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be - removed.""" - system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) - """System metadata for the resource. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio.delta``. Required. RESPONSE_OUTPUT_AUDIO_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") + """Base64-encoded audio data delta. Required.""" @overload def __init__( self, *, - enabled: bool, - trigger: "_models.Trigger", - task: "_models.ScheduleTask", - display_name: Optional[str] = None, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - properties: Optional[dict[str, str]] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: bytes, ) -> None: ... @overload @@ -25962,36 +25535,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DELTA # type: ignore -class ScheduleRoutineTrigger( - RoutineTrigger, discriminator="schedule" +class RealtimeServerEventResponseAudioDone( + RealtimeServerEvent, discriminator="response.output_audio.done" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A recurring cron-based routine trigger. + """Returned when the model-generated audio is done. Also emitted when a Response is interrupted, + incomplete, or cancelled. - :ivar type: The trigger type. Required. A recurring cron-based trigger. - :vartype type: str or ~azure.ai.projects.models.SCHEDULE - :ivar cron_expression: A 5-field cron expression. The service enforces a minimum interval of - five minutes by default. Required. - :vartype cron_expression: str - :ivar time_zone: An IANA or Windows time zone identifier for the schedule. Required. - :vartype time_zone: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio.done``. Required. + RESPONSE_OUTPUT_AUDIO_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int """ - type: Literal[RoutineTriggerType.SCHEDULE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A recurring cron-based trigger.""" - cron_expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. - Required.""" - time_zone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An IANA or Windows time zone identifier for the schedule. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio.done``. Required. RESPONSE_OUTPUT_AUDIO_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" @overload def __init__( self, *, - cron_expression: str, - time_zone: str, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, ) -> None: ... @overload @@ -26003,47 +25592,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.SCHEDULE # type: ignore + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_DONE # type: ignore -class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Schedule run model. +class RealtimeServerEventResponseAudioTranscriptDelta( + RealtimeServerEvent, discriminator="response.output_audio_transcript.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated transcription of audio output is updated. - :ivar run_id: Identifier of the schedule run. Required. - :vartype run_id: str - :ivar schedule_id: Identifier of the schedule. Required. - :vartype schedule_id: str - :ivar success: Trigger success status of the schedule run. Required. - :vartype success: bool - :ivar trigger_time: Trigger time of the schedule run. - :vartype trigger_time: ~datetime.datetime - :ivar error: Error information for the schedule run. - :vartype error: str - :ivar properties: Properties of the schedule run. Required. - :vartype properties: dict[str, str] + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio_transcript.delta``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar delta: The transcript delta. Required. + :vartype delta: str """ - run_id: str = rest_field(name="id", visibility=["read"]) - """Identifier of the schedule run. Required.""" - schedule_id: str = rest_field(name="scheduleId", visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the schedule. Required.""" - success: bool = rest_field(visibility=["read"]) - """Trigger success status of the schedule run. Required.""" - trigger_time: Optional[datetime.datetime] = rest_field( - name="triggerTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Trigger time of the schedule run.""" - error: Optional[str] = rest_field(visibility=["read"]) - """Error information for the schedule run.""" - properties: dict[str, str] = rest_field(visibility=["read"]) - """Properties of the schedule run. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio_transcript.delta``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The transcript delta. Required.""" @overload def __init__( self, *, - schedule_id: str, - trigger_time: Optional[datetime.datetime] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, ) -> None: ... @overload @@ -26055,28 +25654,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA # type: ignore -class SessionConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Session defaults applied to sessions created for a hosted agent version. +class RealtimeServerEventResponseAudioTranscriptDone( + RealtimeServerEvent, discriminator="response.output_audio_transcript.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated transcription of audio output is done streaming. Also emitted + when a Response is interrupted, incomplete, or cancelled. - :ivar idle_timeout_seconds: The idle duration, in seconds, before a session's sandbox is - suspended. When omitted, the server defaults to 900 seconds. Must be between 120 and 14400 - seconds (4 hours). - :vartype idle_timeout_seconds: ~datetime.timedelta + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_audio_transcript.done``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar transcript: The final transcript of the audio. Required. + :vartype transcript: str """ - idle_timeout_seconds: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """The idle duration, in seconds, before a session's sandbox is suspended. When omitted, the - server defaults to 900 seconds. Must be between 120 and 14400 seconds (4 hours).""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_audio_transcript.done``. Required. + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final transcript of the audio. Required.""" @overload def __init__( self, *, - idle_timeout_seconds: Optional[datetime.timedelta] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + transcript: str, ) -> None: ... @overload @@ -26088,40 +25717,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE # type: ignore -class SessionDirectoryEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single entry in a directory listing. +class RealtimeServerEventResponseContentPartAdded( + RealtimeServerEvent, discriminator="response.content_part.added" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a new content part is added to an assistant message item during response + generation. - :ivar name: The name of the file or directory. Required. - :vartype name: str - :ivar size: The size in bytes (0 for directories). Required. - :vartype size: int - :ivar is_directory: Whether this entry is a directory. Required. - :vartype is_directory: bool - :ivar modified_time: The Unix timestamp (in seconds) when the file was last modified. Required. - :vartype modified_time: ~datetime.datetime + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.content_part.added``. Required. + RESPONSE_CONTENT_PART_ADDED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_ADDED + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item to which the content part was added. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar part: The content part that was added. Required. + :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartAddedPart """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the file or directory. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The size in bytes (0 for directories). Required.""" - is_directory: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this entry is a directory. Required.""" - modified_time: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item to which the content part was added. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + part: "_models.RealtimeServerEventResponseContentPartAddedPart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The Unix timestamp (in seconds) when the file was last modified. Required.""" + """The content part that was added. Required.""" @overload def __init__( self, *, - name: str, - size: int, - is_directory: bool, - modified_time: datetime.datetime, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartAddedPart", ) -> None: ... @overload @@ -26133,29 +25781,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_ADDED # type: ignore -class SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response from uploading a file to a session sandbox. +class RealtimeServerEventResponseContentPartAddedPart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartAddedPart. - :ivar path: The path where the file was written, relative to the session home directory. - Required. - :vartype path: str - :ivar bytes_written: Number of bytes written. Required. - :vartype bytes_written: int + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str """ - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path where the file was written, relative to the session home directory. Required.""" - bytes_written: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of bytes written. Required.""" + type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - path: str, - bytes_written: int, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -26169,51 +25826,56 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A single Server-Sent Event frame emitted by the hosted agent session log stream. - - Each frame contains an ``event`` field identifying the event type and a ``data`` - field carrying the payload as plain text. Although the current ``data`` payload - is JSON-formatted, its schema is not contractual — additional keys may appear - and the format may change over time. Clients should treat ``data`` as an - opaque string and optionally attempt JSON parsing. - - New event types may be added in the future. Clients should gracefully - ignore unrecognized event types. - - Wire format: - - .. code-block:: - - event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} +class RealtimeServerEventResponseContentPartDone( + RealtimeServerEvent, discriminator="response.content_part.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a content part is done streaming in an assistant message item. Also emitted when + a Response is interrupted, incomplete, or cancelled. - event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.content_part.done``. Required. + RESPONSE_CONTENT_PART_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar part: The content part that is done. Required. + :vartype part: ~azure.ai.projects.models.RealtimeServerEventResponseContentPartDonePart + """ - :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in - the future. Clients should ignore unrecognized event types. Required. "log" - :vartype event: str or ~azure.ai.projects.models.SessionLogEventType - :ivar data: The event payload as plain text. Currently JSON-formatted but the schema is not - contractual and may change. Required. - :vartype data: str - """ - - event: Union[str, "_models.SessionLogEventType"] = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + part: "_models.RealtimeServerEventResponseContentPartDonePart" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The SSE event type. Currently ``log``, but additional event types may be added in the future. - Clients should ignore unrecognized event types. Required. \"log\"""" - data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event payload as plain text. Currently JSON-formatted but the schema is not contractual and - may change. Required.""" + """The content part that is done. Required.""" @overload def __init__( self, *, - event: Union[str, "_models.SessionLogEventType"], - data: str, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + part: "_models.RealtimeServerEventResponseContentPartDonePart", ) -> None: ... @overload @@ -26225,27 +25887,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_CONTENT_PART_DONE # type: ignore -class SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The sharepoint grounding tool parameters. +class RealtimeServerEventResponseContentPartDonePart( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """RealtimeServerEventResponseContentPartDonePart. - :ivar project_connections: The project connections attached to this tool. There can be a - maximum of 1 connection resource attached to the tool. - :vartype project_connections: list[~azure.ai.projects.models.ToolProjectConnection] + :ivar type: Is either a Literal["audio"] type or a Literal["text"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar transcript: + :vartype transcript: str + :ivar format: The audio format, when this is an audio content part. + :vartype format: ~azure.ai.projects.models.RealtimeAudioFormats """ - project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( + type: Optional[Literal["audio", "text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a Literal[\"audio\"] type or a Literal[\"text\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + format: Optional["_models.RealtimeAudioFormats"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" + """The audio format, when this is an audio content part.""" @overload def __init__( self, *, - project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + type: Optional[Literal["audio", "text"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + transcript: Optional[str] = None, + format: Optional["_models.RealtimeAudioFormats"] = None, ) -> None: ... @overload @@ -26259,32 +25939,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SharepointPreviewTool( - Tool, discriminator="sharepoint_grounding_preview" +class RealtimeServerEventResponseCreated( + RealtimeServerEvent, discriminator="response.created" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """The input definition information for a sharepoint tool as used to configure an agent. + """Returned when a new Response is created. The first event of response creation, where the + response is in an initial state of ``in_progress``. - :ivar type: The object type, which is always 'sharepoint_grounding_preview'. Required. - SHAREPOINT_GROUNDING_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.SHAREPOINT_GROUNDING_PREVIEW - :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. - :vartype sharepoint_grounding_preview: - ~azure.ai.projects.models.SharepointGroundingToolParameters + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.created``. Required. RESPONSE_CREATED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATED + :ivar response: Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse """ - type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'sharepoint_grounding_preview'. Required. - SHAREPOINT_GROUNDING_PREVIEW.""" - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters" = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The sharepoint grounding tool parameters. Required.""" + """Required.""" @overload def __init__( self, *, - sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + event_id: str, + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -26296,52 +25979,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.SHAREPOINT_GROUNDING_PREVIEW # type: ignore + self.type = RealtimeServerEventType.RESPONSE_CREATED # type: ignore -class ShellToolboxTool( - ToolboxTool, discriminator="shell" +class RealtimeServerEventResponseDone( + RealtimeServerEvent, discriminator="response.done" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A shell tool stored in a toolbox. This model is additive to toolbox configuration and does not - modify the OpenAI tool contract or existing toolbox tool definitions. + """Returned when a Response is done streaming. Always emitted, no matter the final state. The + Response object included in the ``response.done`` event will include all output Items in the + Response but will omit the raw audio data. Clients should check the ``status`` field of the + Response to determine if it was successful (``completed``) or if there was another outcome: + ``cancelled``, ``failed``, or ``incomplete``. A response will contain all output items that + were generated during the response, excluding any audio content. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: The type of the tool. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL - :ivar allowed_callers: - :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] - :ivar environment: The environment in which shell commands are executed. Specify an - automatically provisioned container or an existing container. Required. - :vartype environment: ~azure.ai.projects.models.ToolboxShellEnvironment + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.done``. Required. RESPONSE_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_DONE + :ivar response: Required. + :vartype response: ~azure.ai.projects.models.VoiceAgentRealtimeResponse """ - type: Literal[ToolboxToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``shell``. Required. SHELL.""" - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - environment: "_models.ToolboxShellEnvironment" = rest_field( + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" + response: "_models.VoiceAgentRealtimeResponse" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The environment in which shell commands are executed. Specify an automatically provisioned - container or an existing container. Required.""" + """Required.""" @overload def __init__( self, *, - environment: "_models.ToolboxShellEnvironment", - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + event_id: str, + response: "_models.VoiceAgentRealtimeResponse", ) -> None: ... @overload @@ -26353,47 +26026,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.SHELL # type: ignore + self.type = RealtimeServerEventType.RESPONSE_DONE # type: ignore -class SimpleQnADataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="simple_qna" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """The configuration for a data generation job with SimpleQnA type. +class RealtimeServerEventResponseFunctionCallArgumentsDelta( + RealtimeServerEvent, discriminator="response.function_call_arguments.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when the model-generated function call arguments are updated. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is SimpleQnA for this model. Required. Simple - question and answers between user and agent. - :vartype type: str or ~azure.ai.projects.models.SIMPLE_QNA - :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. - Required. - :vartype max_samples: int - :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. - :vartype question_types: list[str or ~azure.ai.projects.models.SimpleQnAFineTuningQuestionType] + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.function_call_arguments.delta``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the function call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar call_id: The ID of the function call. Required. + :vartype call_id: str + :ivar delta: The arguments delta as a JSON string. Required. + :vartype delta: str """ - type: Literal[DataGenerationJobType.SIMPLE_QNA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is SimpleQnA for this model. Required. Simple question and - answers between user and agent.""" - max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of samples to generate, up to service-defined limits. Required.""" - question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The question types to generate. Used only for fine-tuning scenarios.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.function_call_arguments.delta``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The arguments delta as a JSON string. Required.""" @overload def __init__( self, *, - max_samples: int, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, - question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + call_id: str, + delta: str, ) -> None: ... @overload @@ -26405,36 +26088,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore + self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore -class SimulationSeedDataGenerationJobConfiguration( - DataGenerationJobConfiguration, discriminator="simulation_seed" +class RealtimeServerEventResponseFunctionCallArgumentsDone( + RealtimeServerEvent, discriminator="response.function_call_arguments.done" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The configuration for a task generation data generation job. Use with multiturn evaluation - scenarios and with prompt, file, or agent sources. Generated dataset rows include fields such - as ``id``, ``category``, ``test_case_description``, and ``desired_num_turns``. + """Returned when the model-generated function call arguments are done streaming. Also emitted when + a Response is interrupted, incomplete, or cancelled. - :ivar train_split: The proportion of the generated data to be used for training when the data - is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. - :vartype train_split: float - :ivar model_options: The LLM model options. - :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions - :ivar type: The data generation job type, which is SimulationSeed for this model. Required. - Simulation seed for evaluation scenarios. - :vartype type: str or ~azure.ai.projects.models.SIMULATION_SEED + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.function_call_arguments.done``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the function call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar call_id: The ID of the function call. Required. + :vartype call_id: str + :ivar name: The name of the function that was called. Required. + :vartype name: str + :ivar arguments: The final arguments as a JSON string. Required. + :vartype arguments: str """ - type: Literal[DataGenerationJobType.SIMULATION_SEED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed - for evaluation scenarios.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.function_call_arguments.done``. Required. + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function that was called. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final arguments as a JSON string. Required.""" @overload def __init__( self, *, - train_split: Optional[float] = None, - model_options: Optional["_models.DataGenerationModelOptions"] = None, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + call_id: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -26446,30 +26156,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DataGenerationJobType.SIMULATION_SEED # type: ignore + self.type = RealtimeServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore -class SipTelephonyTransferDestination( - TelephonyTransferDestination, discriminator="sip" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A SIP destination for a telephony transfer target. +class RealtimeServerEventResponseMCPCallArgumentsDelta( + RealtimeServerEvent, discriminator="response.mcp_call_arguments.delta" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when MCP tool call arguments are updated during response generation. - :ivar kind: The SIP destination type. Required. A Session Initiation Protocol destination. - :vartype kind: str or ~azure.ai.projects.models.SIP - :ivar value: The SIP or SIPS URI to call. Required. - :vartype value: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call_arguments.delta``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar delta: The JSON-encoded arguments delta. Required. + :vartype delta: str + :ivar obfuscation: + :vartype obfuscation: str """ - kind: Literal[TelephonyTransferDestinationKind.SIP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The SIP destination type. Required. A Session Initiation Protocol destination.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SIP or SIPS URI to call. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call_arguments.delta``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON-encoded arguments delta. Required.""" + obfuscation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - value: str, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + delta: str, + obfuscation: Optional[str] = None, ) -> None: ... @overload @@ -26481,52 +26217,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelephonyTransferDestinationKind.SIP # type: ignore + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA # type: ignore -class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A skill resource. +class RealtimeServerEventResponseMCPCallArgumentsDone( + RealtimeServerEvent, discriminator="response.mcp_call_arguments.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when MCP tool call arguments are finalized during response generation. - :ivar id: The unique identifier of the skill. Required. - :vartype id: str - :ivar name: The unique name of the skill. Required. - :vartype name: str - :ivar description: A human-readable description of the skill. Required. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the skill was created. Required. - :vartype created_at: ~datetime.datetime - :ivar default_version: The default version for the skill. Can be changed via updateSkill. - Required. - :vartype default_version: str - :ivar latest_version: The latest version for the skill. Required. - :vartype latest_version: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call_arguments.done``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar arguments: The final JSON-encoded arguments string. Required. + :vartype arguments: str """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique name of the skill. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the skill. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the skill was created. Required.""" - default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default version for the skill. Can be changed via updateSkill. Required.""" - latest_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The latest version for the skill. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call_arguments.done``. Required. + RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final JSON-encoded arguments string. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - description: str, - created_at: datetime.datetime, - default_version: str, - latest_version: str, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + arguments: str, ) -> None: ... @overload @@ -26538,52 +26274,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE # type: ignore -class SkillInlineContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Inline content for defining a simple skill without uploading files. Follows the agentskills.io - SKILL.md specification. +class RealtimeServerEventResponseMCPCallCompleted( + RealtimeServerEvent, discriminator="response.mcp_call.completed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has completed successfully. - :ivar description: A human-readable description of what the skill does and when to use it. - Required. - :vartype description: str - :ivar instructions: The skill instructions in markdown format. This is the body content of the - SKILL.md file. Required. - :vartype instructions: str - :ivar license: License name or reference to a bundled license file. - :vartype license: str - :ivar compatibility: Environment requirements or compatibility notes for the skill. - :vartype compatibility: str - :ivar metadata: Arbitrary key-value metadata for additional properties. - :vartype metadata: dict[str, str] - :ivar allowed_tools: List of pre-approved tools the skill may use. Experimental. - :vartype allowed_tools: list[str] + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call.completed``. Required. + RESPONSE_MCP_CALL_COMPLETED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_COMPLETED + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str """ - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of what the skill does and when to use it. Required.""" - instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The skill instructions in markdown format. This is the body content of the SKILL.md file. - Required.""" - license: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """License name or reference to a bundled license file.""" - compatibility: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Environment requirements or compatibility notes for the skill.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Arbitrary key-value metadata for additional properties.""" - allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of pre-approved tools the skill may use. Experimental.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call.completed``. Required. RESPONSE_MCP_CALL_COMPLETED.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" @overload def __init__( self, *, - description: str, - instructions: str, - license: Optional[str] = None, - compatibility: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - allowed_tools: Optional[list[str]] = None, + event_id: str, + output_index: int, + item_id: str, ) -> None: ... @overload @@ -26595,30 +26320,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_COMPLETED # type: ignore -class SkillReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reference to a versioned Foundry skill. +class RealtimeServerEventResponseMCPCallFailed( + RealtimeServerEvent, discriminator="response.mcp_call.failed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has failed. - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar version: The skill version. If omitted, the current default version is resolved and - pinned when the agent version is created. - :vartype version: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call.failed``. Required. + RESPONSE_MCP_CALL_FAILED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_FAILED + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The skill version. If omitted, the current default version is resolved and pinned when the - agent version is created.""" - - @overload - def __init__( - self, - *, - name: str, - version: Optional[str] = None, + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call.failed``. Required. RESPONSE_MCP_CALL_FAILED.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" + + @overload + def __init__( + self, + *, + event_id: str, + output_index: int, + item_id: str, ) -> None: ... @overload @@ -26630,34 +26366,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_FAILED # type: ignore -class SkillReferenceParam( - ContainerSkill, discriminator="skill_reference" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """SkillReferenceParam. +class RealtimeServerEventResponseMCPCallInProgress( + RealtimeServerEvent, discriminator="response.mcp_call.in_progress" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an MCP tool call has started and is in progress. - :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. - :vartype type: str or ~azure.ai.projects.models.SKILL_REFERENCE - :ivar skill_id: The ID of the referenced skill. Required. - :vartype skill_id: str - :ivar version: Optional skill version. Use a positive integer or 'latest'. Omit for default. - :vartype version: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.mcp_call.in_progress``. Required. + RESPONSE_MCP_CALL_IN_PROGRESS. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_IN_PROGRESS + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar item_id: The ID of the MCP tool call item. Required. + :vartype item_id: str """ - type: Literal[ContainerSkillType.SKILL_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" - skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced skill. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.mcp_call.in_progress``. Required. + RESPONSE_MCP_CALL_IN_PROGRESS.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item. Required.""" @overload def __init__( self, *, - skill_id: str, - version: Optional[str] = None, + event_id: str, + output_index: int, + item_id: str, ) -> None: ... @overload @@ -26669,51 +26413,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContainerSkillType.SKILL_REFERENCE # type: ignore + self.type = RealtimeServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS # type: ignore -class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A specific version of a skill. +class RealtimeServerEventResponseOutputItemAdded( + RealtimeServerEvent, discriminator="response.output_item.added" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when a new Item is created during Response generation. - :ivar id: The unique identifier of the skill version. Required. - :vartype id: str - :ivar skill_id: The identifier of the parent skill. Required. - :vartype skill_id: str - :ivar name: The name of the skill version. Required. - :vartype name: str - :ivar version: The version identifier. Skill versions are immutable. Required. - :vartype version: str - :ivar description: A human-readable description of the skill version. Required. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the skill version was created. Required. - :vartype created_at: ~datetime.datetime + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_item.added``. Required. + RESPONSE_OUTPUT_ITEM_ADDED. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_ADDED + :ivar response_id: The ID of the Response to which the item belongs. Required. + :vartype response_id: str + :ivar output_index: The index of the output item in the Response. Required. + :vartype output_index: int + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the skill version. Required.""" - skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The identifier of the parent skill. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill version. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier. Skill versions are immutable. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the skill version. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the skill version was created. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Response to which the item belongs. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the Response. Required.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - skill_id: str, - name: str, - version: str, - description: str, - created_at: datetime.datetime, + event_id: str, + response_id: str, + output_index: int, + item: "_models.RealtimeConversationItem", ) -> None: ... @overload @@ -26725,38 +26464,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_ADDED # type: ignore -class ToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """How the model should select which tool (or tools) to use when generating a response. See the - ``tools`` parameter to see how to specify which tools the model can call. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, ToolChoiceComputer, - ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, - ToolChoiceFunction, ToolChoiceImageGeneration, ToolChoiceMCP, - SpecificProgrammaticToolCallingParam, SpecificFunctionShellParam, ToolChoiceWebSearchPreview, - ToolChoiceWebSearchPreview20250311 +class RealtimeServerEventResponseOutputItemDone( + RealtimeServerEvent, discriminator="response.output_item.done" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Returned when an Item is done streaming. Also emitted when a Response is interrupted, + incomplete, or cancelled. - :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", - "programmatic_tool_calling", "apply_patch", "shell", "file_search", "web_search_preview", - "computer_use_preview", "web_search_preview_2025_03_11", "image_generation", - "code_interpreter", "computer", and "computer_use". - :vartype type: str or ~azure.ai.projects.models.ToolChoiceParamType + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_item.done``. Required. + RESPONSE_OUTPUT_ITEM_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_DONE + :ivar response_id: The ID of the Response to which the item belongs. Required. + :vartype response_id: str + :ivar output_index: The index of the output item in the Response. Required. + :vartype output_index: int + :ivar item: Required. + :vartype item: ~azure.ai.projects.models.RealtimeConversationItem """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", - \"programmatic_tool_calling\", \"apply_patch\", \"shell\", \"file_search\", - \"web_search_preview\", \"computer_use_preview\", \"web_search_preview_2025_03_11\", - \"image_generation\", \"code_interpreter\", \"computer\", and \"computer_use\".""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the Response to which the item belongs. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the Response. Required.""" + item: "_models.RealtimeConversationItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - type: str, + event_id: str, + response_id: str, + output_index: int, + item: "_models.RealtimeConversationItem", ) -> None: ... @overload @@ -26768,21 +26516,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_ITEM_DONE # type: ignore -class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): - """Specific apply patch tool choice. +class RealtimeServerEventResponseTextDelta( + RealtimeServerEvent, discriminator="response.output_text.delta" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the text value of an "output_text" content part is updated. - :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. - :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_text.delta``. Required. + RESPONSE_OUTPUT_TEXT_DELTA. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DELTA + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar delta: The text delta. Required. + :vartype delta: str """ - type: Literal[ToolChoiceParamType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_text.delta``. Required. RESPONSE_OUTPUT_TEXT_DELTA.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta. Required.""" @overload def __init__( self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, ) -> None: ... @overload @@ -26794,22 +26577,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.APPLY_PATCH # type: ignore + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DELTA # type: ignore -class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): - """Specific shell tool choice. +class RealtimeServerEventResponseTextDone( + RealtimeServerEvent, discriminator="response.output_text.done" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when the text value of an "output_text" content part is done streaming. Also emitted + when a Response is interrupted, incomplete, or cancelled. - :ivar type: The tool to call. Always ``shell``. Required. SHELL. - :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``response.output_text.done``. Required. + RESPONSE_OUTPUT_TEXT_DONE. + :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DONE + :ivar response_id: The ID of the response. Required. + :vartype response_id: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. + :vartype output_index: int + :ivar content_index: The index of the content part in the item's content array. Required. + :vartype content_index: int + :ivar text: The final text content. Required. + :vartype text: str """ - type: Literal[ToolChoiceParamType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The tool to call. Always ``shell``. Required. SHELL.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.output_text.done``. Required. RESPONSE_OUTPUT_TEXT_DONE.""" + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part in the item's content array. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final text content. Required.""" @overload def __init__( self, + *, + event_id: str, + response_id: str, + item_id: str, + output_index: int, + content_index: int, + text: str, ) -> None: ... @overload @@ -26821,23 +26639,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.SHELL # type: ignore + self.type = RealtimeServerEventType.RESPONSE_OUTPUT_TEXT_DONE # type: ignore -class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): - """SpecificProgrammaticToolCallingParam. +class RealtimeServerEventSessionCreated( + RealtimeServerEvent, discriminator="session.created" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Returned when a Session is created. Emitted automatically when a new connection is established + as the first server event. This event will contain the default Session configuration. - :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. - PROGRAMMATIC_TOOL_CALLING. - :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``session.created``. Required. SESSION_CREATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_CREATED + :ivar session: The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig + :ivar conversation_id: The session-scoped conversation id. When present, responses attached to + the session conversation use the same value in ``response.created`` and ``response.done``. + :vartype conversation_id: str """ - type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The tool to call. Always ``programmatic_tool_calling``. Required. PROGRAMMATIC_TOOL_CALLING.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.SESSION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``session.created``. Required. SESSION_CREATED.""" + session: "_unions.VoiceAgentSessionResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session-scoped conversation id. When present, responses attached to the session + conversation use the same value in ``response.created`` and ``response.done``.""" @overload def __init__( self, + *, + event_id: str, + session: "_unions.VoiceAgentSessionResponse", + conversation_id: Optional[str] = None, ) -> None: ... @overload @@ -26849,32 +26691,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING # type: ignore + self.type = RealtimeServerEventType.SESSION_CREATED # type: ignore -class SteeringPromptOptimizationContext( - OptimizationContext, discriminator="steering_prompt" +class RealtimeServerEventSessionUpdated( + RealtimeServerEvent, discriminator="session.updated" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Natural-language guidance for the desired optimization. + """Returned when a session is updated with a ``session.update`` event, unless there is an error. - :ivar type: Optimization context type discriminator. Required. Natural-language guidance that - steers the desired optimization. - :vartype type: str or ~azure.ai.projects.models.STEERING_PROMPT - :ivar prompt: Developer guidance describing the desired changes. Required. - :vartype prompt: str + :ivar event_id: The unique ID of the server event. Required. + :vartype event_id: str + :ivar type: The event type, must be ``session.updated``. Required. SESSION_UPDATED. + :vartype type: str or ~azure.ai.projects.models.SESSION_UPDATED + :ivar session: The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig + :vartype session: ~azure.ai.projects.models.VoiceAgentSessionResponseConfig """ - type: Literal[OptimizationContextType.STEERING_PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Optimization context type discriminator. Required. Natural-language guidance that steers the - desired optimization.""" - prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Developer guidance describing the desired changes. Required.""" + event_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the server event. Required.""" + type: Literal[RealtimeServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" + session: "_unions.VoiceAgentSessionResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The session configuration. Required. Is one of the following types: + VoiceAgentSessionResponseConfig""" @overload def __init__( self, *, - prompt: str, + event_id: str, + session: "_unions.VoiceAgentSessionResponse", ) -> None: ... @overload @@ -26886,42 +26735,60 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OptimizationContextType.STEERING_PROMPT # type: ignore + self.type = RealtimeServerEventType.SESSION_UPDATED # type: ignore -class StructuredInputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An structured input that can participate in prompt template substitutions and tool argument - binding. +class Reasoning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reasoning. - :ivar description: A human-readable description of the input. - :vartype description: str - :ivar default_value: The default value for the input if no run-time value is provided. - :vartype default_value: any - :ivar schema: The JSON schema for the structured input (optional). - :vartype schema: dict[str, any] - :ivar required: Whether the input property is required when the agent is invoked. The service - defaults to ``false`` if a value is not specified by the caller. - :vartype required: bool + :ivar mode: Controls the reasoning execution mode for the request. When returned on a response, + this is the effective execution mode. Known values are: "standard" and "pro". + :vartype mode: str or ~azure.ai.projects.models.ReasoningModeEnum + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", "xhigh", and "max". + :vartype effort: str or ~azure.ai.projects.models.ReasoningEffort + :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype summary: str or str or str + :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], + Literal["all_turns"] + :vartype context: str or str or str + :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype generate_summary: str or str or str """ - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the input.""" - default_value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default value for the input if no run-time value is provided.""" - schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema for the structured input (optional).""" - required: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input property is required when the agent is invoked. The service defaults to - ``false`` if a value is not specified by the caller.""" + mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls the reasoning execution mode for the request. When returned on a response, this is the + effective execution mode. Known values are: \"standard\" and \"pro\".""" + effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", and \"max\".""" + summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + context: Optional[Literal["auto", "current_turn", "all_turns"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], + Literal[\"all_turns\"]""" + generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" @overload def __init__( self, *, - description: Optional[str] = None, - default_value: Optional[Any] = None, - schema: Optional[dict[str, Any]] = None, - required: Optional[bool] = None, + mode: Optional[Union[str, "_models.ReasoningModeEnum"]] = None, + effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, + summary: Optional[Literal["auto", "concise", "detailed"]] = None, + context: Optional[Literal["auto", "current_turn", "all_turns"]] = None, + generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None, ) -> None: ... @overload @@ -26935,38 +26802,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A structured output that can be produced by the agent. +class RecurrenceTrigger( + Trigger, discriminator="Recurrence" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recurrence based trigger. - :ivar name: The name of the structured output. Required. - :vartype name: str - :ivar description: A description of the output to emit. Used by the model to determine when to - emit the output. Required. - :vartype description: str - :ivar schema: The JSON schema for the structured output. Required. - :vartype schema: dict[str, any] - :ivar strict: Whether to enforce strict validation. Default ``true``. Required. - :vartype strict: bool + :ivar type: Type of the trigger. Required. Recurrence based trigger. + :vartype type: str or ~azure.ai.projects.models.RECURRENCE + :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time for the recurrence schedule in ISO 8601 format. + :vartype end_time: ~datetime.datetime + :ivar time_zone: Time zone for the recurrence schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar interval: Interval for the recurrence schedule. Required. + :vartype interval: int + :ivar schedule: Recurrence schedule for the recurrence trigger. Required. + :vartype schedule: ~azure.ai.projects.models.RecurrenceSchedule """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the structured output. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of the output to emit. Used by the model to determine when to emit the output. - Required.""" - schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema for the structured output. Required.""" - strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enforce strict validation. Default ``true``. Required.""" + type: Literal[TriggerType.RECURRENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of the trigger. Required. Recurrence based trigger.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Start time for the recurrence schedule in ISO 8601 format.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """End time for the recurrence schedule in ISO 8601 format.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the recurrence schedule. Defaults to ``UTC``.""" + interval: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Interval for the recurrence schedule. Required.""" + schedule: "_models.RecurrenceSchedule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Recurrence schedule for the recurrence trigger. Required.""" @overload def __init__( self, *, - name: str, - description: str, - schema: dict[str, Any], - strict: bool, + interval: int, + schedule: "_models.RecurrenceSchedule", + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -26978,51 +26858,144 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TriggerType.RECURRENCE # type: ignore -class SupervisedFineTuningDataGenerationJob( - DataGenerationJob, discriminator="supervised_finetuning_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Supervised fine-tuning data generation job resource. This is a preview feature. +class RedTeam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Red team details. - :ivar id: Server-assigned unique identifier. Required. - :vartype id: str - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.DataGenerationJobResult - :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", - "succeeded", "failed", and "cancelled". - :vartype status: str or ~azure.ai.projects.models.JobStatus - :ivar error: Error details — populated only on failure. - :vartype error: ~azure.ai.projects.models.ApiError - :ivar name: The display name of the data generation job. Required. + :ivar name: Identifier of the red team run. Required. :vartype name: str - :ivar sources: The sources used for the data generation job. Required. - :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] - :ivar generation_configuration: The generation configuration for the data generation job. - Required. - :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds - since January 1, 1970). Required. - :vartype created_at: ~datetime.datetime - :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds - since January 1, 1970). + :ivar display_name: Name of the red-team run. + :vartype display_name: str + :ivar num_turns: Number of simulation rounds. + :vartype num_turns: int + :ivar attack_strategies: List of attack strategies or nested lists of attack strategies. + :vartype attack_strategies: list[str or ~azure.ai.projects.models.AttackStrategy] + :ivar simulation_only: Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs + conversation not evaluation result. The service defaults to ``false`` if a value is not + specified by the caller. + :vartype simulation_only: bool + :ivar risk_categories: List of risk categories to generate attack objectives for. + :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] + :ivar application_scenario: Application scenario for the red team operation, to generate + scenario specific attacks. + :vartype application_scenario: str + :ivar tags: Red team's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar status: Status of the red-team. It is set by service and is read-only. + :vartype status: str + :ivar target: Target configuration for the red-team run. Required. + :vartype target: ~azure.ai.projects.models.RedTeamTargetConfig + """ + + name: str = rest_field(name="id", visibility=["read"]) + """Identifier of the red team run. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the red-team run.""" + num_turns: Optional[int] = rest_field(name="numTurns", visibility=["read", "create", "update", "delete", "query"]) + """Number of simulation rounds.""" + attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = rest_field( + name="attackStrategies", visibility=["read", "create", "update", "delete", "query"] + ) + """List of attack strategies or nested lists of attack strategies.""" + simulation_only: Optional[bool] = rest_field( + name="simulationOnly", visibility=["read", "create", "update", "delete", "query"] + ) + """Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs conversation not + evaluation result. The service defaults to ``false`` if a value is not specified by the caller.""" + risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = rest_field( + name="riskCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of risk categories to generate attack objectives for.""" + application_scenario: Optional[str] = rest_field( + name="applicationScenario", visibility=["read", "create", "update", "delete", "query"] + ) + """Application scenario for the red team operation, to generate scenario specific attacks.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Red team's tags. Unlike properties, tags are fully mutable.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Status of the red-team. It is set by service and is read-only.""" + target: "_models.RedTeamTargetConfig" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target configuration for the red-team run. Required.""" + + @overload + def __init__( + self, + *, + target: "_models.RedTeamTargetConfig", + display_name: Optional[str] = None, + num_turns: Optional[int] = None, + attack_strategies: Optional[list[Union[str, "_models.AttackStrategy"]]] = None, + simulation_only: Optional[bool] = None, + risk_categories: Optional[list[Union[str, "_models.RiskCategory"]]] = None, + application_scenario: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReinforcementFineTuningDataGenerationJob( + DataGenerationJob, discriminator="reinforcement_finetuning_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Reinforcement fine-tuning data generation job resource. This is a preview feature. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.DataGenerationJobResult + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.JobStatus + :ivar error: Error details — populated only on failure. + :vartype error: ~azure.ai.projects.models.ApiError + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: ~datetime.datetime + :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds + since January 1, 1970). :vartype finished_at: ~datetime.datetime - :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning - preview for this model. Required. Supervised Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated supervised + :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning + preview for this model. Required. Reinforcement Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated reinforcement fine-tuning data. :vartype output_configuration: - ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration """ - scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Supervised Fine-tuning preview for this - model. Required. Supervised Fine-tuning preview scenario.""" - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this + model. Required. Reinforcement Fine-tuning preview scenario.""" + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional file output configuration for the generated supervised fine-tuning data.""" + """Optional file output configuration for the generated reinforcement fine-tuning data.""" @overload def __init__( @@ -27031,7 +27004,7 @@ def __init__( name: str, sources: list["_models.DataGenerationJobSource"], generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, ) -> None: ... @overload @@ -27043,13 +27016,13 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore -class SupervisedFineTuningDataGenerationJobInputs( - DataGenerationJobInputs, discriminator="supervised_finetuning_preview" +class ReinforcementFineTuningDataGenerationJobInputs( + DataGenerationJobInputs, discriminator="reinforcement_finetuning_preview" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Caller-supplied inputs for a supervised fine-tuning data generation job. This is a preview + """Caller-supplied inputs for a reinforcement fine-tuning data generation job. This is a preview feature. :ivar name: The display name of the data generation job. Required. @@ -27059,22 +27032,22 @@ class SupervisedFineTuningDataGenerationJobInputs( :ivar generation_configuration: The generation configuration for the data generation job. Required. :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration - :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning - preview for this model. Required. Supervised Fine-tuning preview scenario. - :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW - :ivar output_configuration: Optional file output configuration for the generated supervised + :ivar scenario: The scenario of the data generation job, which is Reinforcement Fine-tuning + preview for this model. Required. Reinforcement Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.REINFORCEMENT_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated reinforcement fine-tuning data. :vartype output_configuration: - ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + ~azure.ai.projects.models.ReinforcementFineTuningDataGenerationJobOutputConfiguration """ - scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The scenario of the data generation job, which is Supervised Fine-tuning preview for this - model. Required. Supervised Fine-tuning preview scenario.""" - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + scenario: Literal[DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Reinforcement Fine-tuning preview for this + model. Required. Reinforcement Fine-tuning preview scenario.""" + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional file output configuration for the generated supervised fine-tuning data.""" + """Optional file output configuration for the generated reinforcement fine-tuning data.""" @overload def __init__( @@ -27083,7 +27056,7 @@ def __init__( name: str, sources: list["_models.DataGenerationJobSource"], generation_configuration: "_models.DataGenerationJobConfiguration", - output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + output_configuration: Optional["_models.ReinforcementFineTuningDataGenerationJobOutputConfiguration"] = None, ) -> None: ... @overload @@ -27095,14 +27068,14 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + self.scenario = DataGenerationJobScenario.REINFORCEMENT_FINETUNING_PREVIEW # type: ignore -class SupervisedFineTuningDataGenerationJobOutputConfiguration( +class ReinforcementFineTuningDataGenerationJobOutputConfiguration( _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """File output configuration for a supervised fine-tuning data generation job. This is a preview - feature. + """File output configuration for a reinforcement fine-tuning data generation job. This is a + preview feature. :ivar name: Filename to assign to the generated fine-tuning file. Required. :vartype name: str @@ -27144,56 +27117,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Taxonomy category definition. +class ReminderPreviewToolboxTool( + ToolboxTool, discriminator="reminder_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reminder tool stored in a toolbox. - :ivar id: Unique identifier of the taxonomy category. Required. - :vartype id: str - :ivar name: Name of the taxonomy category. Required. + :ivar name: Optional user-defined name for this tool or configuration. :vartype name: str - :ivar description: Description of the taxonomy category. + :ivar description: Optional user-defined description for this tool or configuration. :vartype description: str - :ivar risk_category: Risk category associated with this taxonomy category. Required. Known - values are: "HateUnfairness", "Violence", "Sexual", "SelfHarm", "ProtectedMaterial", - "CodeVulnerability", "UngroundedAttributes", "ProhibitedActions", "SensitiveDataLeakage", and - "TaskAdherence". - :vartype risk_category: str or ~azure.ai.projects.models.RiskCategory - :ivar sub_categories: List of taxonomy sub categories. Required. - :vartype sub_categories: list[~azure.ai.projects.models.TaxonomySubCategory] - :ivar properties: Additional properties for the taxonomy category. - :vartype properties: dict[str, str] + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: Required. REMINDER_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.REMINDER_PREVIEW """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique identifier of the taxonomy category. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the taxonomy category. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the taxonomy category.""" - risk_category: Union[str, "_models.RiskCategory"] = rest_field( - name="riskCategory", visibility=["read", "create", "update", "delete", "query"] - ) - """Risk category associated with this taxonomy category. Required. Known values are: - \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", - \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", - \"SensitiveDataLeakage\", and \"TaskAdherence\".""" - sub_categories: list["_models.TaxonomySubCategory"] = rest_field( - name="subCategories", visibility=["read", "create", "update", "delete", "query"] - ) - """List of taxonomy sub categories. Required.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the taxonomy category.""" + type: Literal[ToolboxToolType.REMINDER_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. REMINDER_PREVIEW.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - risk_category: Union[str, "_models.RiskCategory"], - sub_categories: list["_models.TaxonomySubCategory"], + name: Optional[str] = None, description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -27205,43 +27155,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.REMINDER_PREVIEW # type: ignore -class TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Taxonomy sub-category definition. +class ResponsesProtocolConfiguration(_Model): + """Configuration specific to the responses protocol.""" - :ivar id: Unique identifier of the taxonomy sub-category. Required. - :vartype id: str - :ivar name: Name of the taxonomy sub-category. Required. - :vartype name: str - :ivar description: Description of the taxonomy sub-category. - :vartype description: str - :ivar enabled: List of taxonomy items under this sub-category. Required. - :vartype enabled: bool - :ivar properties: Additional properties for the taxonomy sub-category. - :vartype properties: dict[str, str] + +class ResponseUsageInputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageInputTokensDetails. + + :ivar cached_tokens: Required. + :vartype cached_tokens: int + :ivar cache_write_tokens: Required. + :vartype cache_write_tokens: int """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique identifier of the taxonomy sub-category. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the taxonomy sub-category. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the taxonomy sub-category.""" - enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of taxonomy items under this sub-category. Required.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional properties for the taxonomy sub-category.""" + cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + cache_write_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - name: str, - enabled: bool, - description: Optional[str] = None, - properties: Optional[dict[str, str]] = None, + cached_tokens: int, + cache_write_tokens: int, ) -> None: ... @overload @@ -27255,55 +27195,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A telephony binding owned by a voice agent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TeamsPhoneExtensibilityTelephonyBinding, TwilioTelephonyBinding +class ResponseUsageOutputTokensDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageOutputTokensDetails. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int """ - __mapping__: dict[str, _Model] = {} - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated binding identifier. Required.""" - provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name for the telephony provider. Required.""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display label for the binding.""" - status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" - incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated webhook URL to configure with the telephony provider. Required.""" + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: str, - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - label: Optional[str] = None, + reasoning_tokens: int, ) -> None: ... @overload @@ -27317,51 +27223,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TeamsPhoneExtensibilityTelephonyBinding( - TelephonyBinding, discriminator="teams_phone_extensibility" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Microsoft Teams Phone extensibility binding owned by a voice agent. +class ResponseUsageResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ResponseUsageResource. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams - Phone extensibility. - :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY - :ivar phone_number: The optional display phone number for the Teams resource account. - :vartype phone_number: str - :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a - GUID. Required. - :vartype resource_account_object_id: str + :ivar input_tokens: Required. + :vartype input_tokens: int + :ivar input_tokens_details: Required. + :vartype input_tokens_details: ~azure.ai.projects.models.InputTokensDetailsResource + :ivar output_tokens: Required. + :vartype output_tokens: int + :ivar output_tokens_details: Required. + :vartype output_tokens_details: ~azure.ai.projects.models.OutputTokensDetailsResource + :ivar total_tokens: Required. + :vartype total_tokens: int """ - provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone - extensibility.""" - phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display phone number for the Teams resource account.""" - resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + input_tokens_details: "_models.InputTokensDetailsResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_tokens_details: "_models.OutputTokensDetailsResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - resource_account_object_id: str, - label: Optional[str] = None, - phone_number: Optional[str] = None, + input_tokens: int, + input_tokens_details: "_models.InputTokensDetailsResource", + output_tokens: int, + output_tokens_details: "_models.OutputTokensDetailsResource", + total_tokens: int, ) -> None: ... @overload @@ -27373,64 +27273,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore -class TelephonyBindingListItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A telephony binding returned in a list, including its entity tag. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TeamsPhoneExtensibilityTelephonyBindingListItem, TwilioTelephonyBindingListItem +class Routine(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A routine definition returned by the service. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this - binding. Required. - :vartype etag: str + :ivar name: The routine name. + :vartype name: str + :ivar description: A human-readable description of the routine. + :vartype description: str + :ivar enabled: Whether the routine is enabled. Required. + :vartype enabled: bool + :ivar triggers: The triggers configured for the routine. + :vartype triggers: dict[str, ~azure.ai.projects.models.RoutineTrigger] + :ivar action: The action executed when the routine fires. + :vartype action: ~azure.ai.projects.models.RoutineAction + :ivar created_at: The time when the routine was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time when the routine was last updated. + :vartype updated_at: ~datetime.datetime """ - __mapping__: dict[str, _Model] = {} - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated binding identifier. Required.""" - provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name for the telephony provider. Required.""" - label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display label for the binding.""" - status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The routine name.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the routine.""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the routine is enabled. Required.""" + triggers: Optional[dict[str, "_models.RoutineTrigger"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" - incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated webhook URL to configure with the telephony provider. Required.""" - etag: str = rest_field(visibility=["read"]) - """The entity tag to send in the ``If-Match`` header when updating or deleting this binding. - Required.""" + """The triggers configured for the routine.""" + action: Optional["_models.RoutineAction"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action executed when the routine fires.""" + created_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the routine was created.""" + updated_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the routine was last updated.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: str, - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - label: Optional[str] = None, + enabled: bool, + name: Optional[str] = None, + description: Optional[str] = None, + triggers: Optional[dict[str, "_models.RoutineTrigger"]] = None, + action: Optional["_models.RoutineAction"] = None, + created_at: Optional[datetime.datetime] = None, + updated_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -27444,54 +27339,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TeamsPhoneExtensibilityTelephonyBindingListItem( - TelephonyBindingListItem, discriminator="teams_phone_extensibility" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """A Microsoft Teams Phone extensibility binding returned in a list, including its entity tag. +class RoutineAuthorization(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Optional authorization configuration for a routine dispatch. - :ivar id: The service-generated binding identifier. Required. - :vartype id: str - :ivar connection_name: The Foundry connection name for the telephony provider. Required. - :vartype connection_name: str - :ivar label: The optional display label for the binding. - :vartype label: str - :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". - :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus - :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony - provider. Required. - :vartype incoming_call_url: str - :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this - binding. Required. - :vartype etag: str - :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams - Phone extensibility. - :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY - :ivar phone_number: The optional display phone number for the Teams resource account. - :vartype phone_number: str - :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a - GUID. Required. - :vartype resource_account_object_id: str + :ivar identity: The identity used when dispatching the routine. Defaults to agent when omitted; + set to creator only when the customer opts in to creator identity dispatch. Known values are: + "agent" and "creator". + :vartype identity: str or ~azure.ai.projects.models.RoutineDispatchIdentity """ - provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone - extensibility.""" - phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The optional display phone number for the Teams resource account.""" - resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity used when dispatching the routine. Defaults to agent when omitted; set to creator + only when the customer opts in to creator identity dispatch. Known values are: \"agent\" and + \"creator\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - connection_name: str, - status: Union[str, "_models.TelephonyBindingStatus"], - incoming_call_url: str, - resource_account_object_id: str, - label: Optional[str] = None, - phone_number: Optional[str] = None, + identity: Optional[Union[str, "_models.RoutineDispatchIdentity"]] = None, ) -> None: ... @overload @@ -27503,32 +27371,164 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore -class TeamsTelephonyTransferDestination( - TelephonyTransferDestination, discriminator="teams" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Microsoft Teams destination for a telephony transfer target. +class RoutineRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single routine run returned from the run history API. - :ivar kind: The Microsoft Teams destination type. Required. A Microsoft Teams user or - resource-account destination. - :vartype kind: str or ~azure.ai.projects.models.TEAMS - :ivar value: The Microsoft Teams user or resource-account identifier. Required. - :vartype value: str + :ivar id: The unique run identifier for the routine attempt. Required. + :vartype id: str + :ivar status: The run status. Is one of the following types: str + :vartype status: str + :ivar phase: The AgentExtensions lifecycle phase for the routine attempt. Known values are: + "queued", "dispatching", "completed", and "failed". + :vartype phase: str or ~azure.ai.projects.models.RoutineRunPhase + :ivar trigger_type: The trigger type that produced the routine attempt. Known values are: + "custom", "github_issue", "schedule", and "timer". + :vartype trigger_type: str or ~azure.ai.projects.models.RoutineTriggerType + :ivar trigger_name: The configured trigger name that produced the routine attempt. + :vartype trigger_name: str + :ivar trigger_event_payload: The event payload captured from the event that triggered the + routine attempt, when available. + :vartype trigger_event_payload: dict[str, any] + :ivar attempt_source: The source path that created the routine attempt. Known values are: + "event_fire", "manual_dispatch", "queued_dispatch", "schedule_delivery", and "timer_delivery". + :vartype attempt_source: str or ~azure.ai.projects.models.RoutineAttemptSource + :ivar action_type: The action type dispatched for the routine attempt. Known values are: + "invoke_agent_responses_api" and "invoke_agent_invocations_api". + :vartype action_type: str or ~azure.ai.projects.models.RoutineActionType + :ivar agent_id: The project-scoped agent identifier recorded for the routine attempt. + :vartype agent_id: str + :ivar agent_endpoint_id: The legacy endpoint-scoped agent identifier recorded for the routine + attempt. + :vartype agent_endpoint_id: str + :ivar conversation_id: The conversation identifier used by a responses API dispatch. + :vartype conversation_id: str + :ivar session_id: The hosted-agent session identifier used by an invocations API dispatch. + :vartype session_id: str + :ivar triggered_at: The logical trigger time recorded for the routine attempt. + :vartype triggered_at: ~datetime.datetime + :ivar scheduled_fire_at: The scheduled fire time recorded for timer and schedule deliveries. + :vartype scheduled_fire_at: ~datetime.datetime + :ivar started_at: The time when the underlying run started. + :vartype started_at: ~datetime.datetime + :ivar ended_at: The time when the underlying run reached a terminal state. + :vartype ended_at: ~datetime.datetime + :ivar dispatch_id: The dispatch identifier associated with the routine attempt. + :vartype dispatch_id: str + :ivar action_correlation_id: The downstream action correlation identifier, when available. + :vartype action_correlation_id: str + :ivar response_id: The downstream response or invocation identifier, when available. + :vartype response_id: str + :ivar task_id: The workspace task identifier linked to the routine attempt, when available. + :vartype task_id: str + :ivar error_status_code: The downstream error status code captured for a failed attempt, when + available. + :vartype error_status_code: int + :ivar error_type: The fully qualified error type captured for a failed attempt, when available. + :vartype error_type: str + :ivar error_message: The truncated failure message captured for a failed attempt, when + available. + :vartype error_message: str """ - kind: Literal[TelephonyTransferDestinationKind.TEAMS] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The Microsoft Teams destination type. Required. A Microsoft Teams user or resource-account - destination.""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Microsoft Teams user or resource-account identifier. Required.""" + id: str = rest_field(visibility=["read"]) + """The unique run identifier for the routine attempt. Required.""" + status: Optional["_unions.RoutineRunStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The run status. Is one of the following types: str""" + phase: Optional[Union[str, "_models.RoutineRunPhase"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The AgentExtensions lifecycle phase for the routine attempt. Known values are: \"queued\", + \"dispatching\", \"completed\", and \"failed\".""" + trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The trigger type that produced the routine attempt. Known values are: \"custom\", + \"github_issue\", \"schedule\", and \"timer\".""" + trigger_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The configured trigger name that produced the routine attempt.""" + trigger_event_payload: Optional[dict[str, Any]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event payload captured from the event that triggered the routine attempt, when available.""" + attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The source path that created the routine attempt. Known values are: \"event_fire\", + \"manual_dispatch\", \"queued_dispatch\", \"schedule_delivery\", and \"timer_delivery\".""" + action_type: Optional[Union[str, "_models.RoutineActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The action type dispatched for the routine attempt. Known values are: + \"invoke_agent_responses_api\" and \"invoke_agent_invocations_api\".""" + agent_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The project-scoped agent identifier recorded for the routine attempt.""" + agent_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The legacy endpoint-scoped agent identifier recorded for the routine attempt.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The conversation identifier used by a responses API dispatch.""" + session_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The hosted-agent session identifier used by an invocations API dispatch.""" + triggered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The logical trigger time recorded for the routine attempt.""" + scheduled_fire_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The scheduled fire time recorded for timer and schedule deliveries.""" + started_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the underlying run started.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The time when the underlying run reached a terminal state.""" + dispatch_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The dispatch identifier associated with the routine attempt.""" + action_correlation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The downstream action correlation identifier, when available.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The downstream response or invocation identifier, when available.""" + task_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workspace task identifier linked to the routine attempt, when available.""" + error_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The downstream error status code captured for a failed attempt, when available.""" + error_type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The fully qualified error type captured for a failed attempt, when available.""" + error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The truncated failure message captured for a failed attempt, when available.""" @overload def __init__( self, *, - value: str, + status: Optional["_unions.RoutineRunStatus"] = None, + phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, + trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, + trigger_name: Optional[str] = None, + trigger_event_payload: Optional[dict[str, Any]] = None, + attempt_source: Optional[Union[str, "_models.RoutineAttemptSource"]] = None, + action_type: Optional[Union[str, "_models.RoutineActionType"]] = None, + agent_id: Optional[str] = None, + agent_endpoint_id: Optional[str] = None, + conversation_id: Optional[str] = None, + session_id: Optional[str] = None, + triggered_at: Optional[datetime.datetime] = None, + scheduled_fire_at: Optional[datetime.datetime] = None, + started_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + dispatch_id: Optional[str] = None, + action_correlation_id: Optional[str] = None, + response_id: Optional[str] = None, + task_id: Optional[str] = None, + error_status_code: Optional[int] = None, + error_type: Optional[str] = None, + error_message: Optional[str] = None, ) -> None: ... @overload @@ -27540,26 +27540,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = TelephonyTransferDestinationKind.TEAMS # type: ignore -class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. +class RubricBasedEvaluatorDefinition( + EvaluatorDefinition, discriminator="rubric" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for + both quality and safety evaluators. - :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. - :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] + :ivar type: Required. Rubric-based evaluator definition. Stores dimensions (the scoring + blueprint) for both quality and safety evaluators. Can be created via the generate API or + manually via createVersion. + :vartype type: str or ~azure.ai.projects.models.RUBRIC + :ivar dimensions: The set of dimensions — the scoring blueprint used by the LLM judge. Quality + evaluators include a non-editable residual dimension with id 'general_quality' + (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the + same Dimension structure. Required. + :vartype dimensions: list[~azure.ai.projects.models.Dimension] + :ivar pass_threshold: Pass/fail threshold for the aggregate rubric score, on the same + normalized 0.0-1.0 scale as the emitted ``score``. When the runtime weighted average meets or + exceeds this value, the result is ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted + average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this + threshold. + :vartype pass_threshold: float """ - endpoints: list["_models.TelemetryEndpoint"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Customer-supplied telemetry export endpoint configurations. Required.""" + type: Literal[EvaluatorDefinitionType.RUBRIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Rubric-based evaluator definition. Stores dimensions (the scoring blueprint) for both + quality and safety evaluators. Can be created via the generate API or manually via + createVersion.""" + dimensions: list["_models.Dimension"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include + a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety + evaluators include 'general_policy_compliance'. Both use the same Dimension structure. + Required.""" + pass_threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the + emitted ``score``. When the runtime weighted average meets or exceeds this value, the result is + ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension + scored 1 → fail' rule still applies regardless of this threshold.""" @overload def __init__( self, *, - endpoints: list["_models.TelemetryEndpoint"], + dimensions: list["_models.Dimension"], + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + pass_threshold: Optional[float] = None, ) -> None: ... @overload @@ -27571,169 +27608,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = EvaluatorDefinitionType.RUBRIC # type: ignore -class TelephonyCallJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A durable direct or campaign-created outbound call intent. +class RubricGenerationInputQualityWarning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A non-fatal advisory produced during rubric evaluator generation when resolved inputs are + technically valid but likely too weak to produce a high-quality rubric. Read-only; + service-generated. Persisted with the terminal EvaluatorGenerationJob. - :ivar destination: The phone destination to call. Required. - :vartype destination: ~azure.ai.projects.models.TelephonyOutboundDestination - :ivar connection_name: The Foundry connection name in the current project used to originate the - call. Its category selects Twilio or Azure Communication Services / Teams Phone extensibility. - No inbound telephony binding is required. Required. - :vartype connection_name: str - :ivar source: The caller identity used to originate the call. For a Twilio connection, provide - an authorized E.164 phone number. For an Azure Communication Services / Teams Phone - extensibility connection, provide the Teams Resource Account object ID. The identity type is - inferred from the connection category; originating does not change inbound routing. Required. - :vartype source: str - :ivar purpose: An optional customer-declared purpose for placing the call. - :vartype purpose: str - :ivar structured_inputs: Structured input values available to the agent and greeting for this - call. Agent-declared inputs are validated against their schemas; omitted optional inputs may - use their Agent-defined default values, while omitted required inputs are rejected. Additional - inputs remain available as dynamic template variables. - :vartype structured_inputs: dict[str, any] - :ivar schedule: The optional execution window. - :vartype schedule: ~azure.ai.projects.models.TelephonyCallJobSchedule - :ivar id: The service-generated call-job identifier. Required. - :vartype id: str - :ivar object: The object type. Always ``telephony.call_job``. Required. Default value is - "telephony.call_job". - :vartype object: str - :ivar agent_name: The name of the voice agent used at execution time. Required. - :vartype agent_name: str - :ivar status: The current call-job lifecycle status. Required. Known values are: "accepted", - "waiting_for_schedule", "queued", "dispatching", "in_progress", "waiting_for_retry", - "cancellation_requested", "completed", "blocked", "expired", "failed", and "cancelled". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallJobStatus - :ivar cancellation: The recorded cancellation request, when cancellation was requested. - :vartype cancellation: ~azure.ai.projects.models.TelephonyCallJobCancellation - :ivar retry_policy: The frozen provider-attempt retry policy. Required. - :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy - :ivar attempt_count: The number of provider attempts created so far. Required. - :vartype attempt_count: int - :ivar next_attempt_at: The Unix timestamp in seconds at which the next retry becomes eligible. - :vartype next_attempt_at: ~datetime.datetime - :ivar terminal_reason: The stable service-generated reason for the overall outbound call job, - which can span multiple provider attempts, when available. Interpret this with ``status``: a - queued job can retain a temporary dispatch-deferral reason. Additional string codes may be - returned. Known values are: "no_answer", "no_answer_timeout", "answer_failed", - "bridge_cancelled", "bridge_failed", "voice_session_configuration_invalid", - "connection_project_mismatch", "outbound_connection_changed", - "outbound_connection_unavailable", "telephony_binding_invalid", "telephony_binding_not_found", - "telephony_binding_inactive", "telephony_binding_changed", "campaign_not_found", - "campaign_cancelled", "campaign_completed", "campaign_failed", - "origination_fence_not_recorded", "origination_reconciliation_timeout", - "cancellation_reconciliation_timeout", and - "provider_callback_timeout_cancellation_reconciliation_timeout". - :vartype terminal_reason: str or ~azure.ai.projects.models.TelephonyCallJobTerminalReason - :ivar revision: The monotonically increasing optimistic-concurrency revision. Required. - :vartype revision: int - :ivar created_at: The Unix timestamp in seconds when the call job was created. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The Unix timestamp in seconds when the call job was last updated. Required. - :vartype updated_at: ~datetime.datetime + :ivar code: Stable searchable machine-readable warning code. Required. Known values are: + "empty_prompt", "short_prompt", "empty_agent_instructions", "short_agent_instructions", + "empty_dataset_content", "short_dataset_content", "low_trace_count", and + "insufficient_total_input". + :vartype code: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningCode + :ivar severity: Advisory severity. Initial values: ``warning``. Required. "warning" + :vartype severity: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSeverity + :ivar message: Human-readable message suitable for direct SDK/CLI/UI display. Must not include + raw prompt, instruction, dataset, or trace text. Required. + :vartype message: str + :ivar source: Which source category the warning applies to. ``aggregate`` is used only for + cross-source warnings. Required. Known values are: "prompt", "agent", "dataset", and + "aggregate". + :vartype source: str or ~azure.ai.projects.models.RubricGenerationInputQualityWarningSource + :ivar source_index: Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning + applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one + source. + :vartype source_index: int """ - destination: "_models.TelephonyOutboundDestination" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The phone destination to call. Required.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name in the current project used to originate the call. Its category - selects Twilio or Azure Communication Services / Teams Phone extensibility. No inbound - telephony binding is required. Required.""" - source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller identity used to originate the call. For a Twilio connection, provide an authorized - E.164 phone number. For an Azure Communication Services / Teams Phone extensibility connection, - provide the Teams Resource Account object ID. The identity type is inferred from the connection - category; originating does not change inbound routing. Required.""" - purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional customer-declared purpose for placing the call.""" - structured_inputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Structured input values available to the agent and greeting for this call. Agent-declared - inputs are validated against their schemas; omitted optional inputs may use their Agent-defined - default values, while omitted required inputs are rejected. Additional inputs remain available - as dynamic template variables.""" - schedule: Optional["_models.TelephonyCallJobSchedule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The optional execution window.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated call-job identifier. Required.""" - object: Literal["telephony.call_job"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type. Always ``telephony.call_job``. Required. Default value is - \"telephony.call_job\".""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the voice agent used at execution time. Required.""" - status: Union[str, "_models.TelephonyCallJobStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The current call-job lifecycle status. Required. Known values are: \"accepted\", - \"waiting_for_schedule\", \"queued\", \"dispatching\", \"in_progress\", \"waiting_for_retry\", - \"cancellation_requested\", \"completed\", \"blocked\", \"expired\", \"failed\", and - \"cancelled\".""" - cancellation: Optional["_models.TelephonyCallJobCancellation"] = rest_field( + code: Union[str, "_models.RubricGenerationInputQualityWarningCode"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The recorded cancellation request, when cancellation was requested.""" - retry_policy: "_models.TelephonyOutboundRetryPolicy" = rest_field( + """Stable searchable machine-readable warning code. Required. Known values are: \"empty_prompt\", + \"short_prompt\", \"empty_agent_instructions\", \"short_agent_instructions\", + \"empty_dataset_content\", \"short_dataset_content\", \"low_trace_count\", and + \"insufficient_total_input\".""" + severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The frozen provider-attempt retry policy. Required.""" - attempt_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of provider attempts created so far. Required.""" - next_attempt_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds at which the next retry becomes eligible.""" - terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = rest_field( + """Advisory severity. Initial values: ``warning``. Required. \"warning\"""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, + instruction, dataset, or trace text. Required.""" + source: Union[str, "_models.RubricGenerationInputQualityWarningSource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The stable service-generated reason for the overall outbound call job, which can span multiple - provider attempts, when available. Interpret this with ``status``: a queued job can retain a - temporary dispatch-deferral reason. Additional string codes may be returned. Known values are: - \"no_answer\", \"no_answer_timeout\", \"answer_failed\", \"bridge_cancelled\", - \"bridge_failed\", \"voice_session_configuration_invalid\", \"connection_project_mismatch\", - \"outbound_connection_changed\", \"outbound_connection_unavailable\", - \"telephony_binding_invalid\", \"telephony_binding_not_found\", \"telephony_binding_inactive\", - \"telephony_binding_changed\", \"campaign_not_found\", \"campaign_cancelled\", - \"campaign_completed\", \"campaign_failed\", \"origination_fence_not_recorded\", - \"origination_reconciliation_timeout\", \"cancellation_reconciliation_timeout\", and - \"provider_callback_timeout_cancellation_reconciliation_timeout\".""" - revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The monotonically increasing optimistic-concurrency revision. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds when the call job was created. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds when the call job was last updated. Required.""" + """Which source category the warning applies to. ``aggregate`` is used only for cross-source + warnings. Required. Known values are: \"prompt\", \"agent\", \"dataset\", and \"aggregate\".""" + source_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Zero-based index into ``EvaluatorGenerationJob.sources`` when the warning applies to a specific + source. Omitted for aggregate warnings and for warnings not tied to one source.""" @overload def __init__( self, *, - destination: "_models.TelephonyOutboundDestination", - connection_name: str, - source: str, - id: str, # pylint: disable=redefined-builtin - agent_name: str, - status: Union[str, "_models.TelephonyCallJobStatus"], - retry_policy: "_models.TelephonyOutboundRetryPolicy", - attempt_count: int, - revision: int, - created_at: datetime.datetime, - updated_at: datetime.datetime, - purpose: Optional[str] = None, - structured_inputs: Optional[dict[str, Any]] = None, - schedule: Optional["_models.TelephonyCallJobSchedule"] = None, - cancellation: Optional["_models.TelephonyCallJobCancellation"] = None, - next_attempt_at: Optional[datetime.datetime] = None, - terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = None, + code: Union[str, "_models.RubricGenerationInputQualityWarningCode"], + severity: Union[str, "_models.RubricGenerationInputQualityWarningSeverity"], + message: str, + source: Union[str, "_models.RubricGenerationInputQualityWarningSource"], + source_index: Optional[int] = None, ) -> None: ... @overload @@ -27745,41 +27679,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.object: Literal["telephony.call_job"] = "telephony.call_job" -class TelephonyCallJobCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A cancellation request recorded for an outbound call job. +class SASCredentials(BaseCredentials, discriminator="SAS"): + """Shared Access Signature (SAS) credential definition. - :ivar requested_by: The authenticated principal that requested cancellation. Required. - :vartype requested_by: str - :ivar mode: The cancellation mode applied to the call job. Required. - :vartype mode: str - :ivar requested_at: The Unix timestamp in seconds when cancellation was requested. Required. - :vartype requested_at: ~datetime.datetime - :ivar revision: The call-job revision at which cancellation was recorded. Required. - :vartype revision: int + :ivar type: The credential type. Required. Shared Access Signature (SAS) credential. + :vartype type: str or ~azure.ai.projects.models.SAS + :ivar sas_token: SAS token. + :vartype sas_token: str """ - requested_by: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The authenticated principal that requested cancellation. Required.""" - mode: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The cancellation mode applied to the call job. Required.""" - requested_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp in seconds when cancellation was requested. Required.""" - revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The call-job revision at which cancellation was recorded. Required.""" + type: Literal[CredentialType.SAS] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Shared Access Signature (SAS) credential.""" + sas_token: Optional[str] = rest_field(name="SAS", visibility=["read"]) + """SAS token.""" @overload def __init__( self, - *, - requested_by: str, - mode: str, - requested_at: datetime.datetime, - revision: int, ) -> None: ... @overload @@ -27791,25 +27709,2003 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.SAS # type: ignore -class TelephonyCallJobSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The optional execution window for a direct outbound call. +class Schedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule model. - :ivar not_before: The earliest instant at which dispatch may begin. - :vartype not_before: ~datetime.datetime - :ivar expires_at: The instant after which the call job expires without dispatch. - :vartype expires_at: ~datetime.datetime + :ivar schedule_id: Identifier of the schedule. Required. + :vartype schedule_id: str + :ivar display_name: Name of the schedule. + :vartype display_name: str + :ivar description: Description of the schedule. + :vartype description: str + :ivar enabled: Enabled status of the schedule. Required. + :vartype enabled: bool + :ivar provisioning_status: Provisioning status of the schedule. Known values are: "Creating", + "Updating", "Deleting", "Succeeded", and "Failed". + :vartype provisioning_status: str or ~azure.ai.projects.models.ScheduleProvisioningStatus + :ivar trigger: Trigger for the schedule. Required. + :vartype trigger: ~azure.ai.projects.models.Trigger + :ivar task: Task for the schedule. Required. + :vartype task: ~azure.ai.projects.models.ScheduleTask + :ivar tags: Schedule's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Schedule's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar system_data: System metadata for the resource. Required. + :vartype system_data: dict[str, str] """ - not_before: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + schedule_id: str = rest_field(name="id", visibility=["read"]) + """Identifier of the schedule. Required.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] ) - """The earliest instant at which dispatch may begin.""" - expires_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + """Name of the schedule.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the schedule.""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Enabled status of the schedule. Required.""" + provisioning_status: Optional[Union[str, "_models.ScheduleProvisioningStatus"]] = rest_field( + name="provisioningStatus", visibility=["read"] ) - """The instant after which the call job expires without dispatch.""" + """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", + \"Deleting\", \"Succeeded\", and \"Failed\".""" + trigger: "_models.Trigger" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Trigger for the schedule. Required.""" + task: "_models.ScheduleTask" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Task for the schedule. Required.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schedule's tags. Unlike properties, tags are fully mutable.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + system_data: dict[str, str] = rest_field(name="systemData", visibility=["read"]) + """System metadata for the resource. Required.""" + + @overload + def __init__( + self, + *, + enabled: bool, + trigger: "_models.Trigger", + task: "_models.ScheduleTask", + display_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduleRoutineTrigger( + RoutineTrigger, discriminator="schedule" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A recurring cron-based routine trigger. + + :ivar type: The trigger type. Required. A recurring cron-based trigger. + :vartype type: str or ~azure.ai.projects.models.SCHEDULE + :ivar cron_expression: A 5-field cron expression. The service enforces a minimum interval of + five minutes by default. Required. + :vartype cron_expression: str + :ivar time_zone: An IANA or Windows time zone identifier for the schedule. Required. + :vartype time_zone: str + """ + + type: Literal[RoutineTriggerType.SCHEDULE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A recurring cron-based trigger.""" + cron_expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. + Required.""" + time_zone: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An IANA or Windows time zone identifier for the schedule. Required.""" + + @overload + def __init__( + self, + *, + cron_expression: str, + time_zone: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.SCHEDULE # type: ignore + + +class ScheduleRun(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Schedule run model. + + :ivar run_id: Identifier of the schedule run. Required. + :vartype run_id: str + :ivar schedule_id: Identifier of the schedule. Required. + :vartype schedule_id: str + :ivar success: Trigger success status of the schedule run. Required. + :vartype success: bool + :ivar trigger_time: Trigger time of the schedule run. + :vartype trigger_time: ~datetime.datetime + :ivar error: Error information for the schedule run. + :vartype error: str + :ivar properties: Properties of the schedule run. Required. + :vartype properties: dict[str, str] + """ + + run_id: str = rest_field(name="id", visibility=["read"]) + """Identifier of the schedule run. Required.""" + schedule_id: str = rest_field(name="scheduleId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the schedule. Required.""" + success: bool = rest_field(visibility=["read"]) + """Trigger success status of the schedule run. Required.""" + trigger_time: Optional[datetime.datetime] = rest_field( + name="triggerTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Trigger time of the schedule run.""" + error: Optional[str] = rest_field(visibility=["read"]) + """Error information for the schedule run.""" + properties: dict[str, str] = rest_field(visibility=["read"]) + """Properties of the schedule run. Required.""" + + @overload + def __init__( + self, + *, + schedule_id: str, + trigger_time: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScoreLevelParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ScoreLevelParam. + + :ivar label: Required. + :vartype label: str + :ivar description: + :vartype description: str + """ + + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + label: str, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScoreProbabilityResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ScoreProbabilityResource. + + :ivar value: Required. + :vartype value: int + :ivar label: Required. + :vartype label: str + :ivar probability: Required. + :vartype probability: float + """ + + value: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + probability: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + value: int, + label: str, + probability: float, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Session defaults applied to sessions created for a hosted agent version. + + :ivar idle_timeout_seconds: The idle duration, in seconds, before a session's sandbox is + suspended. When omitted, the server defaults to 900 seconds. Must be between 120 and 14400 + seconds (4 hours). + :vartype idle_timeout_seconds: ~datetime.timedelta + """ + + idle_timeout_seconds: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The idle duration, in seconds, before a session's sandbox is suspended. When omitted, the + server defaults to 900 seconds. Must be between 120 and 14400 seconds (4 hours).""" + + @overload + def __init__( + self, + *, + idle_timeout_seconds: Optional[datetime.timedelta] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionDirectoryEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single entry in a directory listing. + + :ivar name: The name of the file or directory. Required. + :vartype name: str + :ivar size: The size in bytes (0 for directories). Required. + :vartype size: int + :ivar is_directory: Whether this entry is a directory. Required. + :vartype is_directory: bool + :ivar modified_time: The Unix timestamp (in seconds) when the file was last modified. Required. + :vartype modified_time: ~datetime.datetime + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the file or directory. Required.""" + size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The size in bytes (0 for directories). Required.""" + is_directory: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this entry is a directory. Required.""" + modified_time: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) when the file was last modified. Required.""" + + @overload + def __init__( + self, + *, + name: str, + size: int, + is_directory: bool, + modified_time: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionFileWriteResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Response from uploading a file to a session sandbox. + + :ivar path: The path where the file was written, relative to the session home directory. + Required. + :vartype path: str + :ivar bytes_written: Number of bytes written. Required. + :vartype bytes_written: int + """ + + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The path where the file was written, relative to the session home directory. Required.""" + bytes_written: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of bytes written. Required.""" + + @overload + def __init__( + self, + *, + path: str, + bytes_written: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SessionLogEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A single Server-Sent Event frame emitted by the hosted agent session log stream. + + Each frame contains an ``event`` field identifying the event type and a ``data`` + field carrying the payload as plain text. Although the current ``data`` payload + is JSON-formatted, its schema is not contractual — additional keys may appear + and the format may change over time. Clients should treat ``data`` as an + opaque string and optionally attempt JSON parsing. + + New event types may be added in the future. Clients should gracefully + ignore unrecognized event types. + + Wire format: + + .. code-block:: + + event: log + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} + + event: log + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + + :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in + the future. Clients should ignore unrecognized event types. Required. "log" + :vartype event: str or ~azure.ai.projects.models.SessionLogEventType + :ivar data: The event payload as plain text. Currently JSON-formatted but the schema is not + contractual and may change. Required. + :vartype data: str + """ + + event: Union[str, "_models.SessionLogEventType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The SSE event type. Currently ``log``, but additional event types may be added in the future. + Clients should ignore unrecognized event types. Required. \"log\"""" + data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The event payload as plain text. Currently JSON-formatted but the schema is not contractual and + may change. Required.""" + + @overload + def __init__( + self, + *, + event: Union[str, "_models.SessionLogEventType"], + data: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SharepointGroundingToolParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The sharepoint grounding tool parameters. + + :ivar project_connections: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. + :vartype project_connections: list[~azure.ai.projects.models.ToolProjectConnection] + """ + + project_connections: Optional[list["_models.ToolProjectConnection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + @overload + def __init__( + self, + *, + project_connections: Optional[list["_models.ToolProjectConnection"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SharepointPreviewTool( + Tool, discriminator="sharepoint_grounding_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The input definition information for a sharepoint tool as used to configure an agent. + + :ivar type: The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.SHAREPOINT_GROUNDING_PREVIEW + :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. + :vartype sharepoint_grounding_preview: + ~azure.ai.projects.models.SharepointGroundingToolParameters + """ + + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW.""" + sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The sharepoint grounding tool parameters. Required.""" + + @overload + def __init__( + self, + *, + sharepoint_grounding_preview: "_models.SharepointGroundingToolParameters", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.SHAREPOINT_GROUNDING_PREVIEW # type: ignore + + +class ShellToolboxTool( + ToolboxTool, discriminator="shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A shell tool stored in a toolbox. This model is additive to toolbox configuration and does not + modify the OpenAI tool contract or existing toolbox tool definitions. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The type of the tool. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar environment: The environment in which shell commands are executed. Specify an + automatically provisioned container or an existing container. Required. + :vartype environment: ~azure.ai.projects.models.ToolboxShellEnvironment + """ + + type: Literal[ToolboxToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``shell``. Required. SHELL.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + environment: "_models.ToolboxShellEnvironment" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The environment in which shell commands are executed. Specify an automatically provisioned + container or an existing container. Required.""" + + @overload + def __init__( + self, + *, + environment: "_models.ToolboxShellEnvironment", + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolboxToolType.SHELL # type: ignore + + +class SimpleQnADataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="simple_qna" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """The configuration for a data generation job with SimpleQnA type. + + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is SimpleQnA for this model. Required. Simple + question and answers between user and agent. + :vartype type: str or ~azure.ai.projects.models.SIMPLE_QNA + :ivar max_samples: Maximum number of samples to generate, up to service-defined limits. + Required. + :vartype max_samples: int + :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. + :vartype question_types: list[str or ~azure.ai.projects.models.SimpleQnAFineTuningQuestionType] + """ + + type: Literal[DataGenerationJobType.SIMPLE_QNA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is SimpleQnA for this model. Required. Simple question and + answers between user and agent.""" + max_samples: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of samples to generate, up to service-defined limits. Required.""" + question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The question types to generate. Used only for fine-tuning scenarios.""" + + @overload + def __init__( + self, + *, + max_samples: int, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + question_types: Optional[list[Union[str, "_models.SimpleQnAFineTuningQuestionType"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = DataGenerationJobType.SIMPLE_QNA # type: ignore + + +class SimulationSeedDataGenerationJobConfiguration( + DataGenerationJobConfiguration, discriminator="simulation_seed" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The configuration for a task generation data generation job. Use with multiturn evaluation + scenarios and with prompt, file, or agent sources. Generated dataset rows include fields such + as ``id``, ``category``, ``test_case_description``, and ``desired_num_turns``. + + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: ~azure.ai.projects.models.DataGenerationModelOptions + :ivar type: The data generation job type, which is SimulationSeed for this model. Required. + Simulation seed for evaluation scenarios. + :vartype type: str or ~azure.ai.projects.models.SIMULATION_SEED + """ + + type: Literal[DataGenerationJobType.SIMULATION_SEED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The data generation job type, which is SimulationSeed for this model. Required. Simulation seed + for evaluation scenarios.""" + + @overload + def __init__( + self, + *, + train_split: Optional[float] = None, + model_options: Optional["_models.DataGenerationModelOptions"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = DataGenerationJobType.SIMULATION_SEED # type: ignore + + +class SipTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="sip" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A SIP destination for a telephony transfer target. + + :ivar kind: The SIP destination type. Required. A Session Initiation Protocol destination. + :vartype kind: str or ~azure.ai.projects.models.SIP + :ivar value: The SIP or SIPS URI to call. Required. + :vartype value: str + """ + + kind: Literal[TelephonyTransferDestinationKind.SIP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The SIP destination type. Required. A Session Initiation Protocol destination.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SIP or SIPS URI to call. Required.""" + + @overload + def __init__( + self, + *, + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = TelephonyTransferDestinationKind.SIP # type: ignore + + +class SkillDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A skill resource. + + :ivar id: The unique identifier of the skill. Required. + :vartype id: str + :ivar name: The unique name of the skill. Required. + :vartype name: str + :ivar description: A human-readable description of the skill. Required. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the skill was created. Required. + :vartype created_at: ~datetime.datetime + :ivar default_version: The default version for the skill. Can be changed via updateSkill. + Required. + :vartype default_version: str + :ivar latest_version: The latest version for the skill. Required. + :vartype latest_version: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique name of the skill. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the skill. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the skill was created. Required.""" + default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default version for the skill. Can be changed via updateSkill. Required.""" + latest_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latest version for the skill. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + description: str, + created_at: datetime.datetime, + default_version: str, + latest_version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkillInlineContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Inline content for defining a simple skill without uploading files. Follows the agentskills.io + SKILL.md specification. + + :ivar description: A human-readable description of what the skill does and when to use it. + Required. + :vartype description: str + :ivar instructions: The skill instructions in markdown format. This is the body content of the + SKILL.md file. Required. + :vartype instructions: str + :ivar license: License name or reference to a bundled license file. + :vartype license: str + :ivar compatibility: Environment requirements or compatibility notes for the skill. + :vartype compatibility: str + :ivar metadata: Arbitrary key-value metadata for additional properties. + :vartype metadata: dict[str, str] + :ivar allowed_tools: List of pre-approved tools the skill may use. Experimental. + :vartype allowed_tools: list[str] + """ + + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of what the skill does and when to use it. Required.""" + instructions: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The skill instructions in markdown format. This is the body content of the SKILL.md file. + Required.""" + license: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """License name or reference to a bundled license file.""" + compatibility: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Environment requirements or compatibility notes for the skill.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Arbitrary key-value metadata for additional properties.""" + allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of pre-approved tools the skill may use. Experimental.""" + + @overload + def __init__( + self, + *, + description: str, + instructions: str, + license: Optional[str] = None, + compatibility: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + allowed_tools: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkillReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to a versioned Foundry skill. + + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar version: The skill version. If omitted, the current default version is resolved and + pinned when the agent version is created. + :vartype version: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The skill version. If omitted, the current default version is resolved and pinned when the + agent version is created.""" + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SkillReferenceParam( + ContainerSkill, discriminator="skill_reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """SkillReferenceParam. + + :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. + :vartype type: str or ~azure.ai.projects.models.SKILL_REFERENCE + :ivar skill_id: The ID of the referenced skill. Required. + :vartype skill_id: str + :ivar version: Optional skill version. Use a positive integer or 'latest'. Omit for default. + :vartype version: str + """ + + type: Literal[ContainerSkillType.SKILL_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" + skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" + + @overload + def __init__( + self, + *, + skill_id: str, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ContainerSkillType.SKILL_REFERENCE # type: ignore + + +class SkillVersion(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a skill. + + :ivar id: The unique identifier of the skill version. Required. + :vartype id: str + :ivar skill_id: The identifier of the parent skill. Required. + :vartype skill_id: str + :ivar name: The name of the skill version. Required. + :vartype name: str + :ivar version: The version identifier. Skill versions are immutable. Required. + :vartype version: str + :ivar description: A human-readable description of the skill version. Required. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the skill version was created. Required. + :vartype created_at: ~datetime.datetime + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the skill version. Required.""" + skill_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the parent skill. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill version. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier. Skill versions are immutable. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the skill version. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the skill version was created. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + skill_id: str, + name: str, + version: str, + description: str, + created_at: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolChoiceParam(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """How the model should select which tool (or tools) to use when generating a response. See the + ``tools`` parameter to see how to specify which tools the model can call. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, ToolChoiceComputer, + ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, + ToolChoiceFunction, ToolChoiceImageGeneration, ToolChoiceMCP, + SpecificProgrammaticToolCallingParam, SpecificFunctionShellParam, ToolChoiceWebSearchPreview, + ToolChoiceWebSearchPreview20250311 + + :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", + "programmatic_tool_calling", "apply_patch", "shell", "file_search", "web_search_preview", + "computer_use_preview", "web_search_preview_2025_03_11", "image_generation", + "code_interpreter", "computer", and "computer_use". + :vartype type: str or ~azure.ai.projects.models.ToolChoiceParamType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", + \"programmatic_tool_calling\", \"apply_patch\", \"shell\", \"file_search\", + \"web_search_preview\", \"computer_use_preview\", \"web_search_preview_2025_03_11\", + \"image_generation\", \"code_interpreter\", \"computer\", and \"computer_use\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SpecificApplyPatchParam(ToolChoiceParam, discriminator="apply_patch"): + """Specific apply patch tool choice. + + :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + """ + + type: Literal[ToolChoiceParamType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.APPLY_PATCH # type: ignore + + +class SpecificFunctionShellParam(ToolChoiceParam, discriminator="shell"): + """Specific shell tool choice. + + :ivar type: The tool to call. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL + """ + + type: Literal[ToolChoiceParamType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The tool to call. Always ``shell``. Required. SHELL.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.SHELL # type: ignore + + +class SpecificProgrammaticToolCallingParam(ToolChoiceParam, discriminator="programmatic_tool_calling"): + """SpecificProgrammaticToolCallingParam. + + :ivar type: The tool to call. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING + """ + + type: Literal[ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The tool to call. Always ``programmatic_tool_calling``. Required. PROGRAMMATIC_TOOL_CALLING.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.PROGRAMMATIC_TOOL_CALLING # type: ignore + + +class SteeringPromptOptimizationContext( + OptimizationContext, discriminator="steering_prompt" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Natural-language guidance for the desired optimization. + + :ivar type: Optimization context type discriminator. Required. Natural-language guidance that + steers the desired optimization. + :vartype type: str or ~azure.ai.projects.models.STEERING_PROMPT + :ivar prompt: Developer guidance describing the desired changes. Required. + :vartype prompt: str + """ + + type: Literal[OptimizationContextType.STEERING_PROMPT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Optimization context type discriminator. Required. Natural-language guidance that steers the + desired optimization.""" + prompt: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Developer guidance describing the desired changes. Required.""" + + @overload + def __init__( + self, + *, + prompt: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = OptimizationContextType.STEERING_PROMPT # type: ignore + + +class StructuredInputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An structured input that can participate in prompt template substitutions and tool argument + binding. + + :ivar description: A human-readable description of the input. + :vartype description: str + :ivar default_value: The default value for the input if no run-time value is provided. + :vartype default_value: any + :ivar schema: The JSON schema for the structured input (optional). + :vartype schema: dict[str, any] + :ivar required: Whether the input property is required when the agent is invoked. The service + defaults to ``false`` if a value is not specified by the caller. + :vartype required: bool + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the input.""" + default_value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default value for the input if no run-time value is provided.""" + schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema for the structured input (optional).""" + required: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the input property is required when the agent is invoked. The service defaults to + ``false`` if a value is not specified by the caller.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + default_value: Optional[Any] = None, + schema: Optional[dict[str, Any]] = None, + required: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StructuredOutputDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A structured output that can be produced by the agent. + + :ivar name: The name of the structured output. Required. + :vartype name: str + :ivar description: A description of the output to emit. Used by the model to determine when to + emit the output. Required. + :vartype description: str + :ivar schema: The JSON schema for the structured output. Required. + :vartype schema: dict[str, any] + :ivar strict: Whether to enforce strict validation. Default ``true``. Required. + :vartype strict: bool + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the structured output. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the output to emit. Used by the model to determine when to emit the output. + Required.""" + schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON schema for the structured output. Required.""" + strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enforce strict validation. Default ``true``. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + schema: dict[str, Any], + strict: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SupervisedFineTuningDataGenerationJob( + DataGenerationJob, discriminator="supervised_finetuning_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Supervised fine-tuning data generation job resource. This is a preview feature. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.DataGenerationJobResult + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.JobStatus + :ivar error: Error details — populated only on failure. + :vartype error: ~azure.ai.projects.models.ApiError + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: ~datetime.datetime + :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds + since January 1, 1970). + :vartype finished_at: ~datetime.datetime + :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning + preview for this model. Required. Supervised Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated supervised + fine-tuning data. + :vartype output_configuration: + ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + """ + + scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Supervised Fine-tuning preview for this + model. Required. Supervised Fine-tuning preview scenario.""" + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional file output configuration for the generated supervised fine-tuning data.""" + + @overload + def __init__( + self, + *, + name: str, + sources: list["_models.DataGenerationJobSource"], + generation_configuration: "_models.DataGenerationJobConfiguration", + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + + +class SupervisedFineTuningDataGenerationJobInputs( + DataGenerationJobInputs, discriminator="supervised_finetuning_preview" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Caller-supplied inputs for a supervised fine-tuning data generation job. This is a preview + feature. + + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list[~azure.ai.projects.models.DataGenerationJobSource] + :ivar generation_configuration: The generation configuration for the data generation job. + Required. + :vartype generation_configuration: ~azure.ai.projects.models.DataGenerationJobConfiguration + :ivar scenario: The scenario of the data generation job, which is Supervised Fine-tuning + preview for this model. Required. Supervised Fine-tuning preview scenario. + :vartype scenario: str or ~azure.ai.projects.models.SUPERVISED_FINETUNING_PREVIEW + :ivar output_configuration: Optional file output configuration for the generated supervised + fine-tuning data. + :vartype output_configuration: + ~azure.ai.projects.models.SupervisedFineTuningDataGenerationJobOutputConfiguration + """ + + scenario: Literal[DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW] = rest_discriminator(name="scenario", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The scenario of the data generation job, which is Supervised Fine-tuning preview for this + model. Required. Supervised Fine-tuning preview scenario.""" + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional file output configuration for the generated supervised fine-tuning data.""" + + @overload + def __init__( + self, + *, + name: str, + sources: list["_models.DataGenerationJobSource"], + generation_configuration: "_models.DataGenerationJobConfiguration", + output_configuration: Optional["_models.SupervisedFineTuningDataGenerationJobOutputConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.scenario = DataGenerationJobScenario.SUPERVISED_FINETUNING_PREVIEW # type: ignore + + +class SupervisedFineTuningDataGenerationJobOutputConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """File output configuration for a supervised fine-tuning data generation job. This is a preview + feature. + + :ivar name: Filename to assign to the generated fine-tuning file. Required. + :vartype name: str + :ivar write_mode: Controls how file outputs are written. If omitted, defaults to ``overwrite`` + and writes only the newly generated fine-tuning file content. Known values are: "overwrite" and + "merge". + :vartype write_mode: str or ~azure.ai.projects.models.DataGenerationJobOutputWriteMode + :ivar merge_file_id: File ID to merge into when ``write_mode`` is ``merge``. + :vartype merge_file_id: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filename to assign to the generated fine-tuning file. Required.""" + write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Controls how file outputs are written. If omitted, defaults to ``overwrite`` and writes only + the newly generated fine-tuning file content. Known values are: \"overwrite\" and \"merge\".""" + merge_file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """File ID to merge into when ``write_mode`` is ``merge``.""" + + @overload + def __init__( + self, + *, + name: str, + write_mode: Optional[Union[str, "_models.DataGenerationJobOutputWriteMode"]] = None, + merge_file_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaxonomyCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy category definition. + + :ivar id: Unique identifier of the taxonomy category. Required. + :vartype id: str + :ivar name: Name of the taxonomy category. Required. + :vartype name: str + :ivar description: Description of the taxonomy category. + :vartype description: str + :ivar risk_category: Risk category associated with this taxonomy category. Required. Known + values are: "HateUnfairness", "Violence", "Sexual", "SelfHarm", "ProtectedMaterial", + "CodeVulnerability", "UngroundedAttributes", "ProhibitedActions", "SensitiveDataLeakage", and + "TaskAdherence". + :vartype risk_category: str or ~azure.ai.projects.models.RiskCategory + :ivar sub_categories: List of taxonomy sub categories. Required. + :vartype sub_categories: list[~azure.ai.projects.models.TaxonomySubCategory] + :ivar properties: Additional properties for the taxonomy category. + :vartype properties: dict[str, str] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier of the taxonomy category. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the taxonomy category. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the taxonomy category.""" + risk_category: Union[str, "_models.RiskCategory"] = rest_field( + name="riskCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Risk category associated with this taxonomy category. Required. Known values are: + \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", + \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", + \"SensitiveDataLeakage\", and \"TaskAdherence\".""" + sub_categories: list["_models.TaxonomySubCategory"] = rest_field( + name="subCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """List of taxonomy sub categories. Required.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the taxonomy category.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + risk_category: Union[str, "_models.RiskCategory"], + sub_categories: list["_models.TaxonomySubCategory"], + description: Optional[str] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TaxonomySubCategory(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Taxonomy sub-category definition. + + :ivar id: Unique identifier of the taxonomy sub-category. Required. + :vartype id: str + :ivar name: Name of the taxonomy sub-category. Required. + :vartype name: str + :ivar description: Description of the taxonomy sub-category. + :vartype description: str + :ivar enabled: List of taxonomy items under this sub-category. Required. + :vartype enabled: bool + :ivar properties: Additional properties for the taxonomy sub-category. + :vartype properties: dict[str, str] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier of the taxonomy sub-category. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the taxonomy sub-category. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the taxonomy sub-category.""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of taxonomy items under this sub-category. Required.""" + properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional properties for the taxonomy sub-category.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + name: str, + enabled: bool, + description: Optional[str] = None, + properties: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telephony binding owned by a voice agent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TeamsPhoneExtensibilityTelephonyBinding, TwilioTelephonyBinding + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + """ + + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated binding identifier. Required.""" + provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Foundry connection name for the telephony provider. Required.""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display label for the binding.""" + status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" + incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated webhook URL to configure with the telephony provider. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: str, + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + label: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TeamsPhoneExtensibilityTelephonyBinding( + TelephonyBinding, discriminator="teams_phone_extensibility" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft Teams Phone extensibility binding owned by a voice agent. + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams + Phone extensibility. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY + :ivar phone_number: The optional display phone number for the Teams resource account. + :vartype phone_number: str + :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a + GUID. Required. + :vartype resource_account_object_id: str + """ + + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone + extensibility.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display phone number for the Teams resource account.""" + resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + resource_account_object_id: str, + label: Optional[str] = None, + phone_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore + + +class TelephonyBindingListItem(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A telephony binding returned in a list, including its entity tag. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TeamsPhoneExtensibilityTelephonyBindingListItem, TwilioTelephonyBindingListItem + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this + binding. Required. + :vartype etag: str + """ + + __mapping__: dict[str, _Model] = {} + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated binding identifier. Required.""" + provider: str = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Foundry connection name for the telephony provider. Required.""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display label for the binding.""" + status: Union[str, "_models.TelephonyBindingStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status. Required. Known values are: \"active\" and \"suspended\".""" + incoming_call_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated webhook URL to configure with the telephony provider. Required.""" + etag: str = rest_field(visibility=["read"]) + """The entity tag to send in the ``If-Match`` header when updating or deleting this binding. + Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: str, + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + label: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TeamsPhoneExtensibilityTelephonyBindingListItem( + TelephonyBindingListItem, discriminator="teams_phone_extensibility" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """A Microsoft Teams Phone extensibility binding returned in a list, including its entity tag. + + :ivar id: The service-generated binding identifier. Required. + :vartype id: str + :ivar connection_name: The Foundry connection name for the telephony provider. Required. + :vartype connection_name: str + :ivar label: The optional display label for the binding. + :vartype label: str + :ivar status: The lifecycle status. Required. Known values are: "active" and "suspended". + :vartype status: str or ~azure.ai.projects.models.TelephonyBindingStatus + :ivar incoming_call_url: The service-generated webhook URL to configure with the telephony + provider. Required. + :vartype incoming_call_url: str + :ivar etag: The entity tag to send in the ``If-Match`` header when updating or deleting this + binding. Required. + :vartype etag: str + :ivar provider: The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams + Phone extensibility. + :vartype provider: str or ~azure.ai.projects.models.TEAMS_PHONE_EXTENSIBILITY + :ivar phone_number: The optional display phone number for the Teams resource account. + :vartype phone_number: str + :ivar resource_account_object_id: The Microsoft Teams resource-account object identifier as a + GUID. Required. + :vartype resource_account_object_id: str + """ + + provider: Literal[TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY] = rest_discriminator(name="provider", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams Phone extensibility provider. Required. Microsoft Teams Phone + extensibility.""" + phone_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The optional display phone number for the Teams resource account.""" + resource_account_object_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Teams resource-account object identifier as a GUID. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + connection_name: str, + status: Union[str, "_models.TelephonyBindingStatus"], + incoming_call_url: str, + resource_account_object_id: str, + label: Optional[str] = None, + phone_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.provider = TelephonyProvider.TEAMS_PHONE_EXTENSIBILITY # type: ignore + + +class TeamsTelephonyTransferDestination( + TelephonyTransferDestination, discriminator="teams" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft Teams destination for a telephony transfer target. + + :ivar kind: The Microsoft Teams destination type. Required. A Microsoft Teams user or + resource-account destination. + :vartype kind: str or ~azure.ai.projects.models.TEAMS + :ivar value: The Microsoft Teams user or resource-account identifier. Required. + :vartype value: str + """ + + kind: Literal[TelephonyTransferDestinationKind.TEAMS] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft Teams destination type. Required. A Microsoft Teams user or resource-account + destination.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Teams user or resource-account identifier. Required.""" + + @overload + def __init__( + self, + *, + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = TelephonyTransferDestinationKind.TEAMS # type: ignore + + +class TelemetryConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. + + :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. + :vartype endpoints: list[~azure.ai.projects.models.TelemetryEndpoint] + """ + + endpoints: list["_models.TelemetryEndpoint"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Customer-supplied telemetry export endpoint configurations. Required.""" + + @overload + def __init__( + self, + *, + endpoints: list["_models.TelemetryEndpoint"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallJob(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A durable direct or campaign-created outbound call intent. + + :ivar destination: The phone destination to call. Required. + :vartype destination: ~azure.ai.projects.models.TelephonyOutboundDestination + :ivar connection_name: The Foundry connection name in the current project used to originate the + call. Its category selects Twilio or Azure Communication Services / Teams Phone extensibility. + No inbound telephony binding is required. Required. + :vartype connection_name: str + :ivar source: The caller identity used to originate the call. For a Twilio connection, provide + an authorized E.164 phone number. For an Azure Communication Services / Teams Phone + extensibility connection, provide the Teams Resource Account object ID. The identity type is + inferred from the connection category; originating does not change inbound routing. Required. + :vartype source: str + :ivar purpose: An optional customer-declared purpose for placing the call. + :vartype purpose: str + :ivar structured_inputs: Structured input values available to the agent and greeting for this + call. Agent-declared inputs are validated against their schemas; omitted optional inputs may + use their Agent-defined default values, while omitted required inputs are rejected. Additional + inputs remain available as dynamic template variables. + :vartype structured_inputs: dict[str, any] + :ivar schedule: The optional execution window. + :vartype schedule: ~azure.ai.projects.models.TelephonyCallJobSchedule + :ivar id: The service-generated call-job identifier. Required. + :vartype id: str + :ivar object: The object type. Always ``telephony.call_job``. Required. Default value is + "telephony.call_job". + :vartype object: str + :ivar agent_name: The name of the voice agent used at execution time. Required. + :vartype agent_name: str + :ivar status: The current call-job lifecycle status. Required. Known values are: "accepted", + "waiting_for_schedule", "queued", "dispatching", "in_progress", "waiting_for_retry", + "cancellation_requested", "completed", "blocked", "expired", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallJobStatus + :ivar cancellation: The recorded cancellation request, when cancellation was requested. + :vartype cancellation: ~azure.ai.projects.models.TelephonyCallJobCancellation + :ivar retry_policy: The frozen provider-attempt retry policy. Required. + :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy + :ivar attempt_count: The number of provider attempts created so far. Required. + :vartype attempt_count: int + :ivar next_attempt_at: The Unix timestamp in seconds at which the next retry becomes eligible. + :vartype next_attempt_at: ~datetime.datetime + :ivar terminal_reason: The stable service-generated reason for the overall outbound call job, + which can span multiple provider attempts, when available. Interpret this with ``status``: a + queued job can retain a temporary dispatch-deferral reason. Additional string codes may be + returned. Known values are: "no_answer", "no_answer_timeout", "answer_failed", + "bridge_cancelled", "bridge_failed", "voice_session_configuration_invalid", + "connection_project_mismatch", "outbound_connection_changed", + "outbound_connection_unavailable", "telephony_binding_invalid", "telephony_binding_not_found", + "telephony_binding_inactive", "telephony_binding_changed", "campaign_not_found", + "campaign_cancelled", "campaign_completed", "campaign_failed", + "origination_fence_not_recorded", "origination_reconciliation_timeout", + "cancellation_reconciliation_timeout", and + "provider_callback_timeout_cancellation_reconciliation_timeout". + :vartype terminal_reason: str or ~azure.ai.projects.models.TelephonyCallJobTerminalReason + :ivar revision: The monotonically increasing optimistic-concurrency revision. Required. + :vartype revision: int + :ivar created_at: The Unix timestamp in seconds when the call job was created. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The Unix timestamp in seconds when the call job was last updated. Required. + :vartype updated_at: ~datetime.datetime + """ + + destination: "_models.TelephonyOutboundDestination" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The phone destination to call. Required.""" + connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Foundry connection name in the current project used to originate the call. Its category + selects Twilio or Azure Communication Services / Teams Phone extensibility. No inbound + telephony binding is required. Required.""" + source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The caller identity used to originate the call. For a Twilio connection, provide an authorized + E.164 phone number. For an Azure Communication Services / Teams Phone extensibility connection, + provide the Teams Resource Account object ID. The identity type is inferred from the connection + category; originating does not change inbound routing. Required.""" + purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional customer-declared purpose for placing the call.""" + structured_inputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Structured input values available to the agent and greeting for this call. Agent-declared + inputs are validated against their schemas; omitted optional inputs may use their Agent-defined + default values, while omitted required inputs are rejected. Additional inputs remain available + as dynamic template variables.""" + schedule: Optional["_models.TelephonyCallJobSchedule"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The optional execution window.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated call-job identifier. Required.""" + object: Literal["telephony.call_job"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``telephony.call_job``. Required. Default value is + \"telephony.call_job\".""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the voice agent used at execution time. Required.""" + status: Union[str, "_models.TelephonyCallJobStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The current call-job lifecycle status. Required. Known values are: \"accepted\", + \"waiting_for_schedule\", \"queued\", \"dispatching\", \"in_progress\", \"waiting_for_retry\", + \"cancellation_requested\", \"completed\", \"blocked\", \"expired\", \"failed\", and + \"cancelled\".""" + cancellation: Optional["_models.TelephonyCallJobCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The recorded cancellation request, when cancellation was requested.""" + retry_policy: "_models.TelephonyOutboundRetryPolicy" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The frozen provider-attempt retry policy. Required.""" + attempt_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of provider attempts created so far. Required.""" + next_attempt_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds at which the next retry becomes eligible.""" + terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The stable service-generated reason for the overall outbound call job, which can span multiple + provider attempts, when available. Interpret this with ``status``: a queued job can retain a + temporary dispatch-deferral reason. Additional string codes may be returned. Known values are: + \"no_answer\", \"no_answer_timeout\", \"answer_failed\", \"bridge_cancelled\", + \"bridge_failed\", \"voice_session_configuration_invalid\", \"connection_project_mismatch\", + \"outbound_connection_changed\", \"outbound_connection_unavailable\", + \"telephony_binding_invalid\", \"telephony_binding_not_found\", \"telephony_binding_inactive\", + \"telephony_binding_changed\", \"campaign_not_found\", \"campaign_cancelled\", + \"campaign_completed\", \"campaign_failed\", \"origination_fence_not_recorded\", + \"origination_reconciliation_timeout\", \"cancellation_reconciliation_timeout\", and + \"provider_callback_timeout_cancellation_reconciliation_timeout\".""" + revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The monotonically increasing optimistic-concurrency revision. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds when the call job was created. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds when the call job was last updated. Required.""" + + @overload + def __init__( + self, + *, + destination: "_models.TelephonyOutboundDestination", + connection_name: str, + source: str, + id: str, # pylint: disable=redefined-builtin + agent_name: str, + status: Union[str, "_models.TelephonyCallJobStatus"], + retry_policy: "_models.TelephonyOutboundRetryPolicy", + attempt_count: int, + revision: int, + created_at: datetime.datetime, + updated_at: datetime.datetime, + purpose: Optional[str] = None, + structured_inputs: Optional[dict[str, Any]] = None, + schedule: Optional["_models.TelephonyCallJobSchedule"] = None, + cancellation: Optional["_models.TelephonyCallJobCancellation"] = None, + next_attempt_at: Optional[datetime.datetime] = None, + terminal_reason: Optional[Union[str, "_models.TelephonyCallJobTerminalReason"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.object: Literal["telephony.call_job"] = "telephony.call_job" + + +class TelephonyCallJobCancellation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A cancellation request recorded for an outbound call job. + + :ivar requested_by: The authenticated principal that requested cancellation. Required. + :vartype requested_by: str + :ivar mode: The cancellation mode applied to the call job. Required. + :vartype mode: str + :ivar requested_at: The Unix timestamp in seconds when cancellation was requested. Required. + :vartype requested_at: ~datetime.datetime + :ivar revision: The call-job revision at which cancellation was recorded. Required. + :vartype revision: int + """ + + requested_by: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The authenticated principal that requested cancellation. Required.""" + mode: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cancellation mode applied to the call job. Required.""" + requested_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp in seconds when cancellation was requested. Required.""" + revision: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The call-job revision at which cancellation was recorded. Required.""" + + @overload + def __init__( + self, + *, + requested_by: str, + mode: str, + requested_at: datetime.datetime, + revision: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallJobSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The optional execution window for a direct outbound call. + + :ivar not_before: The earliest instant at which dispatch may begin. + :vartype not_before: ~datetime.datetime + :ivar expires_at: The instant after which the call job expires without dispatch. + :vartype expires_at: ~datetime.datetime + """ + + not_before: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The earliest instant at which dispatch may begin.""" + expires_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The instant after which the call job expires without dispatch.""" @overload def __init__( @@ -28100,44 +29996,696 @@ class TelephonyCallRecord(_Model): # pylint: disable=docstring-keyword-should-m """The provider subcode associated with the terminal result.""" provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The provider message associated with the terminal result.""" - timing: "_models.TelephonyCallTiming" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Detailed provider-neutral call timing. Required.""" - trace: Optional["_models.TelephonyCallTrace"] = rest_field( + timing: "_models.TelephonyCallTiming" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Detailed provider-neutral call timing. Required.""" + trace: Optional["_models.TelephonyCallTrace"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Correlation to the customer-facing Foundry trace.""" + events: list["_models.TelephonyCallLifecycleEvent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle timeline. Required.""" + events_truncated: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether older lifecycle events were omitted from the timeline. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: Union[str, "_models.TelephonyProvider"], + status: Union[str, "_models.TelephonyCallStatus"], + phase: Union[str, "_models.TelephonyCallPhase"], + started_at: datetime.datetime, + timing: "_models.TelephonyCallTiming", + events: list["_models.TelephonyCallLifecycleEvent"], + events_truncated: bool, + provider_call_id: Optional[str] = None, + caller_number: Optional[str] = None, + provider_number: Optional[str] = None, + answered_at: Optional[datetime.datetime] = None, + media_connected_at: Optional[datetime.datetime] = None, + agent_session_ready_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + duration_ms: Optional[datetime.timedelta] = None, + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, + provider_status_code: Optional[int] = None, + provider_sub_code: Optional[int] = None, + provider_message: Optional[str] = None, + trace: Optional["_models.TelephonyCallTrace"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A summary of a durable inbound call to a voice agent. + + :ivar id: The service-generated call identifier. Required. + :vartype id: str + :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" + and "twilio". + :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider + :ivar provider_call_id: The provider-assigned call identifier, when available. + :vartype provider_call_id: str + :ivar caller_number: The caller's phone number, when supplied by the provider. + :vartype caller_number: str + :ivar provider_number: The Teams Phone extensibility or Twilio number that received the call. + :vartype provider_number: str + :ivar status: The lifecycle status of the call. Required. Known values are: "in_progress", + "success", and "failed". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallStatus + :ivar phase: The provider-neutral lifecycle phase reached by the call. Required. Known values + are: "received", "validated", "admitted", "answering", "answered", "media_connected", + "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed". + :vartype phase: str or ~azure.ai.projects.models.TelephonyCallPhase + :ivar started_at: The Unix timestamp (in seconds) for when the inbound webhook was received. + Required. + :vartype started_at: ~datetime.datetime + :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported the call as + answered. + :vartype answered_at: ~datetime.datetime + :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel + connected. + :vartype media_connected_at: ~datetime.datetime + :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session + became ready. + :vartype agent_session_ready_at: ~datetime.datetime + :ivar ended_at: The Unix timestamp (in seconds) for when the call ended. + :vartype ended_at: ~datetime.datetime + :ivar duration_ms: The call duration. + :vartype duration_ms: ~datetime.timedelta + :ivar end_reason: The service-generated reason that this single call ended, rather than the + outcome of an overall outbound call job. Additional string codes may be returned. Known values + are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", + "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", + "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", + "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", + "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", + "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", + "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", + "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", + "manage_hangup_failed", and "manage_transfer_failed". + :vartype end_reason: str or ~azure.ai.projects.models.TelephonyCallEndReason + :ivar provider_status_code: The provider status code associated with the terminal result. + :vartype provider_status_code: int + :ivar provider_sub_code: The provider subcode associated with the terminal result. + :vartype provider_sub_code: int + :ivar provider_message: The provider message associated with the terminal result. + :vartype provider_message: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The service-generated call identifier. Required.""" + provider: Union[str, "_models.TelephonyProvider"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and + \"twilio\".""" + provider_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider-assigned call identifier, when available.""" + caller_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The caller's phone number, when supplied by the provider.""" + provider_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Teams Phone extensibility or Twilio number that received the call.""" + status: Union[str, "_models.TelephonyCallStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The lifecycle status of the call. Required. Known values are: \"in_progress\", \"success\", and + \"failed\".""" + phase: Union[str, "_models.TelephonyCallPhase"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-neutral lifecycle phase reached by the call. Required. Known values are: + \"received\", \"validated\", \"admitted\", \"answering\", \"answered\", \"media_connected\", + \"agent_session_ready\", \"bridging\", \"managing\", \"completed\", \"rejected\", and + \"failed\".""" + started_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the inbound webhook was received. Required.""" + answered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider reported the call as answered.""" + media_connected_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider media channel connected.""" + agent_session_ready_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call ended.""" + duration_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" + ) + """The call duration.""" + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The service-generated reason that this single call ended, rather than the outcome of an overall + outbound call job. Additional string codes may be returned. Known values are: + \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", + \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", + \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", + \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", + \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", + \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", + \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", + \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", + \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and + \"manage_transfer_failed\".""" + provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider status code associated with the terminal result.""" + provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider subcode associated with the terminal result.""" + provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The provider message associated with the terminal result.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + provider: Union[str, "_models.TelephonyProvider"], + status: Union[str, "_models.TelephonyCallStatus"], + phase: Union[str, "_models.TelephonyCallPhase"], + started_at: datetime.datetime, + provider_call_id: Optional[str] = None, + caller_number: Optional[str] = None, + provider_number: Optional[str] = None, + answered_at: Optional[datetime.datetime] = None, + media_connected_at: Optional[datetime.datetime] = None, + agent_session_ready_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + duration_ms: Optional[datetime.timedelta] = None, + end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, + provider_status_code: Optional[int] = None, + provider_sub_code: Optional[int] = None, + provider_message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallTiming(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Detailed provider-neutral timing for an inbound telephony call. + + :ivar received_at: The Unix timestamp (in seconds) for when the provider webhook was received. + :vartype received_at: ~datetime.datetime + :ivar validated_at: The Unix timestamp (in seconds) for when webhook validation completed. + :vartype validated_at: ~datetime.datetime + :ivar admitted_at: The Unix timestamp (in seconds) for when the call was admitted to an agent + binding. + :vartype admitted_at: ~datetime.datetime + :ivar answer_requested_at: The Unix timestamp (in seconds) for when the service requested that + the provider answer the call. + :vartype answer_requested_at: ~datetime.datetime + :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported that the call + was answered. + :vartype answered_at: ~datetime.datetime + :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel + connected. + :vartype media_connected_at: ~datetime.datetime + :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session + became ready. + :vartype agent_session_ready_at: ~datetime.datetime + :ivar first_caller_audio_at: The Unix timestamp (in seconds) for when caller audio was first + observed. + :vartype first_caller_audio_at: ~datetime.datetime + :ivar first_agent_audio_at: The Unix timestamp (in seconds) for when agent audio was first + observed. + :vartype first_agent_audio_at: ~datetime.datetime + :ivar ended_at: The Unix timestamp (in seconds) for when the call reached a terminal state. + :vartype ended_at: ~datetime.datetime + :ivar duration_basis: The timestamp used as the basis for duration. Known values are: + "answered" and "received". + :vartype duration_basis: str or ~azure.ai.projects.models.TelephonyCallDurationBasis + :ivar timestamp_source: The primary source of the timing milestones. Individual lifecycle + events identify their own timestamp source separately. Required. Known values are: "provider", + "gateway", and "derived". + :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource + """ + + received_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider webhook was received.""" + validated_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when webhook validation completed.""" + admitted_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call was admitted to an agent binding.""" + answer_requested_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the service requested that the provider answer the + call.""" + answered_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider reported that the call was answered.""" + media_connected_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the provider media channel connected.""" + agent_session_ready_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" + first_caller_audio_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when caller audio was first observed.""" + first_agent_audio_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when agent audio was first observed.""" + ended_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (in seconds) for when the call reached a terminal state.""" + duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Correlation to the customer-facing Foundry trace.""" - events: list["_models.TelephonyCallLifecycleEvent"] = rest_field( + """The timestamp used as the basis for duration. Known values are: \"answered\" and \"received\".""" + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The lifecycle timeline. Required.""" - events_truncated: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether older lifecycle events were omitted from the timeline. Required.""" + """The primary source of the timing milestones. Individual lifecycle events identify their own + timestamp source separately. Required. Known values are: \"provider\", \"gateway\", and + \"derived\".""" + + @overload + def __init__( + self, + *, + timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], + received_at: Optional[datetime.datetime] = None, + validated_at: Optional[datetime.datetime] = None, + admitted_at: Optional[datetime.datetime] = None, + answer_requested_at: Optional[datetime.datetime] = None, + answered_at: Optional[datetime.datetime] = None, + media_connected_at: Optional[datetime.datetime] = None, + agent_session_ready_at: Optional[datetime.datetime] = None, + first_caller_audio_at: Optional[datetime.datetime] = None, + first_agent_audio_at: Optional[datetime.datetime] = None, + ended_at: Optional[datetime.datetime] = None, + duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyCallTrace(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Correlation from a durable telephony call record to its customer-facing Foundry trace. + + :ivar status: The trace availability status. Required. Known values are: "pending", "emitting", + "available", "not_recorded", "not_applicable", and "failed". + :vartype status: str or ~azure.ai.projects.models.TelephonyCallTraceStatus + :ivar trace_id: The W3C trace identifier, when a trace was recorded. + :vartype trace_id: str + :ivar root_span_id: The root span identifier, when a trace was recorded. + :vartype root_span_id: str + :ivar conversation_id: The voice-agent conversation identifier, when a conversation was + created. + :vartype conversation_id: str + :ivar mode: Whether the trace was emitted live or after the call ended. Known values are: + "live" and "post_call". + :vartype mode: str or ~azure.ai.projects.models.TelephonyCallTraceMode + """ + + status: Union[str, "_models.TelephonyCallTraceStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The trace availability status. Required. Known values are: \"pending\", \"emitting\", + \"available\", \"not_recorded\", \"not_applicable\", and \"failed\".""" + trace_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The W3C trace identifier, when a trace was recorded.""" + root_span_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The root span identifier, when a trace was recorded.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The voice-agent conversation identifier, when a conversation was created.""" + mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the trace was emitted live or after the call ended. Known values are: \"live\" and + \"post_call\".""" + + @overload + def __init__( + self, + *, + status: Union[str, "_models.TelephonyCallTraceStatus"], + trace_id: Optional[str] = None, + root_span_id: Optional[str] = None, + conversation_id: Optional[str] = None, + mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyOutboundDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The destination of an outbound call. + + :ivar type: The destination type. Only E.164 phone numbers are currently supported. Required. + "phone_number" + :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundDestinationType + :ivar value: The destination E.164 phone number. Required. + :vartype value: str + """ + + type: Union[str, "_models.TelephonyOutboundDestinationType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The destination type. Only E.164 phone numbers are currently supported. Required. + \"phone_number\"""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The destination E.164 phone number. Required.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.TelephonyOutboundDestinationType"], + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyOutboundRetryPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The retry policy for one durable outbound call intent. ``max_attempts`` includes the first + attempt. Strategy-specific settings are defined by the derived policy. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TelephonyOutboundFixedIntervalRetryPolicy + + :ivar type: The retry strategy. Only fixed-interval retries are currently supported. Required. + "fixed_interval" + :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundRetryPolicyType + :ivar max_attempts: The maximum number of provider attempts, including the first attempt. + Defaults to 1. + :vartype max_attempts: int + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The retry strategy. Only fixed-interval retries are currently supported. Required. + \"fixed_interval\"""" + max_attempts: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of provider attempts, including the first attempt. Defaults to 1.""" + + @overload + def __init__( + self, + *, + type: str, + max_attempts: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyOutboundFixedIntervalRetryPolicy( + TelephonyOutboundRetryPolicy, discriminator="fixed_interval" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The frozen fixed-interval retry policy returned for an outbound call or campaign. + + :ivar max_attempts: The maximum number of provider attempts, including the first attempt. + Defaults to 1. + :vartype max_attempts: int + :ivar type: The fixed-interval retry strategy. Required. Retry after a fixed interval between + attempts. + :vartype type: str or ~azure.ai.projects.models.FIXED_INTERVAL + :ivar interval: The fixed delay in seconds between attempts. Required. + :vartype interval: ~datetime.timedelta + """ + + type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The fixed-interval retry strategy. Required. Retry after a fixed interval between attempts.""" + interval: datetime.timedelta = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" + ) + """The fixed delay in seconds between attempts. Required.""" + + @overload + def __init__( + self, + *, + interval: datetime.timedelta, + max_attempts: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TelephonyOutboundRetryPolicyType.FIXED_INTERVAL # type: ignore + + +class TelephonyTransferTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A named destination to which the voice agent may transfer a call. + + :ivar name: The unique name exposed to the voice agent for this transfer target. Required. + :vartype name: str + :ivar description: A description that helps the voice agent decide when to use this target. + Required. + :vartype description: str + :ivar destination: The provider-specific transfer destination. Required. + :vartype destination: ~azure.ai.projects.models.TelephonyTransferDestination + """ + + name: str = rest_field(visibility=["read", "create"]) + """The unique name exposed to the voice agent for this transfer target. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description that helps the voice agent decide when to use this target. Required.""" + destination: "_models.TelephonyTransferDestination" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provider-specific transfer destination. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + destination: "_models.TelephonyTransferDestination", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TelephonyTransferTargets(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The telephony transfer targets configured for one voice agent. + + :ivar transfer_targets: The complete set of destinations to which the voice agent may transfer + calls. An empty array clears all targets when replacing the configuration. Required. + :vartype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + """ + + transfer_targets: list["_models.TelephonyTransferTarget"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The complete set of destinations to which the voice agent may transfer calls. An empty array + clears all targets when replacing the configuration. Required.""" + + @overload + def __init__( + self, + *, + transfer_targets: list["_models.TelephonyTransferTarget"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An object specifying the format that the model must output. Configuring ``{ "type": + "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied + JSON schema. Learn more in the `Structured Outputs guide + `_. The default format is ``{ + "type": "text" }`` with no additional options. *Not recommended for gpt-4o and newer models:** + Setting to ``{ "type": "json_object" }`` enables the older JSON mode, which ensures the message + the model generates is valid JSON. Using ``json_schema`` is preferred for models that support + it. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText + + :ivar type: Required. Known values are: "text", "json_schema", and "json_object". + :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"text\", \"json_schema\", and \"json_object\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): + """JSON object. + + :ivar type: The type of response format being defined. Always ``json_object``. Required. + JSON_OBJECT. + :vartype type: str or ~azure.ai.projects.models.JSON_OBJECT + """ + + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_OBJECT # type: ignore + + +class TextResponseFormatJsonSchema( + TextResponseFormat, discriminator="json_schema" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """JSON schema. + + :ivar type: The type of response format being defined. Always ``json_schema``. Required. + JSON_SCHEMA. + :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA + :ivar description: A description of what the response format is for, used by the model to + determine how to respond in the format. + :vartype description: str + :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and + dashes, with a maximum length of 64. Required. + :vartype name: str + :ivar schema: Required. + :vartype schema: dict[str, any] + :ivar strict: + :vartype strict: bool + """ + + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the response format is for, used by the model to determine how to respond + in the format.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with + a maximum length of 64. Required.""" + schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: Union[str, "_models.TelephonyProvider"], - status: Union[str, "_models.TelephonyCallStatus"], - phase: Union[str, "_models.TelephonyCallPhase"], - started_at: datetime.datetime, - timing: "_models.TelephonyCallTiming", - events: list["_models.TelephonyCallLifecycleEvent"], - events_truncated: bool, - provider_call_id: Optional[str] = None, - caller_number: Optional[str] = None, - provider_number: Optional[str] = None, - answered_at: Optional[datetime.datetime] = None, - media_connected_at: Optional[datetime.datetime] = None, - agent_session_ready_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - duration_ms: Optional[datetime.timedelta] = None, - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, - provider_status_code: Optional[int] = None, - provider_sub_code: Optional[int] = None, - provider_message: Optional[str] = None, - trace: Optional["_models.TelephonyCallTrace"] = None, + name: str, + schema: dict[str, Any], + description: Optional[str] = None, + strict: Optional[bool] = None, ) -> None: ... @overload @@ -28149,157 +30697,95 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore -class TelephonyCallSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A summary of a durable inbound call to a voice agent. +class TextResponseFormatText(TextResponseFormat, discriminator="text"): + """Text. - :ivar id: The service-generated call identifier. Required. - :vartype id: str - :ivar provider: The telephony provider. Required. Known values are: "teams_phone_extensibility" - and "twilio". - :vartype provider: str or ~azure.ai.projects.models.TelephonyProvider - :ivar provider_call_id: The provider-assigned call identifier, when available. - :vartype provider_call_id: str - :ivar caller_number: The caller's phone number, when supplied by the provider. - :vartype caller_number: str - :ivar provider_number: The Teams Phone extensibility or Twilio number that received the call. - :vartype provider_number: str - :ivar status: The lifecycle status of the call. Required. Known values are: "in_progress", - "success", and "failed". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallStatus - :ivar phase: The provider-neutral lifecycle phase reached by the call. Required. Known values - are: "received", "validated", "admitted", "answering", "answered", "media_connected", - "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed". - :vartype phase: str or ~azure.ai.projects.models.TelephonyCallPhase - :ivar started_at: The Unix timestamp (in seconds) for when the inbound webhook was received. - Required. - :vartype started_at: ~datetime.datetime - :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported the call as - answered. - :vartype answered_at: ~datetime.datetime - :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel - connected. - :vartype media_connected_at: ~datetime.datetime - :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session - became ready. - :vartype agent_session_ready_at: ~datetime.datetime - :ivar ended_at: The Unix timestamp (in seconds) for when the call ended. - :vartype ended_at: ~datetime.datetime - :ivar duration_ms: The call duration. - :vartype duration_ms: ~datetime.timedelta - :ivar end_reason: The service-generated reason that this single call ended, rather than the - outcome of an overall outbound call job. Additional string codes may be returned. Known values - are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", - "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", - "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", - "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", - "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", - "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", - "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", - "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", - "manage_hangup_failed", and "manage_transfer_failed". - :vartype end_reason: str or ~azure.ai.projects.models.TelephonyCallEndReason - :ivar provider_status_code: The provider status code associated with the terminal result. - :vartype provider_status_code: int - :ivar provider_sub_code: The provider subcode associated with the terminal result. - :vartype provider_sub_code: int - :ivar provider_message: The provider message associated with the terminal result. - :vartype provider_message: str + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: str or ~azure.ai.projects.models.TEXT """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-generated call identifier. Required.""" - provider: Union[str, "_models.TelephonyProvider"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The telephony provider. Required. Known values are: \"teams_phone_extensibility\" and - \"twilio\".""" - provider_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider-assigned call identifier, when available.""" - caller_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller's phone number, when supplied by the provider.""" - provider_number: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Teams Phone extensibility or Twilio number that received the call.""" - status: Union[str, "_models.TelephonyCallStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The lifecycle status of the call. Required. Known values are: \"in_progress\", \"success\", and - \"failed\".""" - phase: Union[str, "_models.TelephonyCallPhase"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provider-neutral lifecycle phase reached by the call. Required. Known values are: - \"received\", \"validated\", \"admitted\", \"answering\", \"answered\", \"media_connected\", - \"agent_session_ready\", \"bridging\", \"managing\", \"completed\", \"rejected\", and - \"failed\".""" - started_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the inbound webhook was received. Required.""" - answered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider reported the call as answered.""" - media_connected_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider media channel connected.""" - agent_session_ready_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" - ended_at: Optional[datetime.datetime] = rest_field( + type: Literal[TextResponseFormatConfigurationType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``text``. Required. TEXT.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.TEXT # type: ignore + + +class TimerRoutineTrigger( + RoutineTrigger, discriminator="timer" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A one-shot timer routine trigger. + + :ivar type: The trigger type. Required. A one-shot timer trigger. + :vartype type: str or ~azure.ai.projects.models.TIMER + :ivar at: The UTC date and time at which the timer fires. + :vartype at: ~datetime.datetime + """ + + type: Literal[RoutineTriggerType.TIMER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The trigger type. Required. A one-shot timer trigger.""" + at: Optional[datetime.datetime] = rest_field( visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """The Unix timestamp (in seconds) for when the call ended.""" - duration_ms: Optional[datetime.timedelta] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" - ) - """The call duration.""" - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = rest_field( + """The UTC date and time at which the timer fires.""" + + @overload + def __init__( + self, + *, + at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = RoutineTriggerType.TIMER # type: ignore + + +class ToolApplyPatchToolParam( + Tool, discriminator="apply_patch" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Apply patch tool. + + :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + """ + + type: Literal[ToolType.APPLY_PATCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The service-generated reason that this single call ended, rather than the outcome of an overall - outbound call job. Additional string codes may be returned. Known values are: - \"invalid_webhook_payload\", \"webhook_validation_failed\", \"binding_not_found\", - \"binding_suspended\", \"admission_rejected\", \"admission_check_failed\", - \"route_agent_mismatch\", \"invalid_binding_configuration\", \"credential_resolution_failed\", - \"provider_resource_mismatch\", \"endpoint_resolution_failed\", \"ingress_setup_failed\", - \"live_call_conflict\", \"live_call_persistence_failed\", \"answer_failed\", - \"provider_disconnected\", \"provider_busy\", \"provider_no_answer\", \"provider_cancelled\", - \"provider_failed\", \"provider_stream_error\", \"provider_stream_stopped\", - \"agent_session_connect_failed\", \"media_stream_ended\", \"bridge_cancelled\", - \"bridge_failed\", \"managed_hangup\", \"managed_transfer\", \"manage_hangup_failed\", and - \"manage_transfer_failed\".""" - provider_status_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider status code associated with the terminal result.""" - provider_sub_code: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider subcode associated with the terminal result.""" - provider_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The provider message associated with the terminal result.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - provider: Union[str, "_models.TelephonyProvider"], - status: Union[str, "_models.TelephonyCallStatus"], - phase: Union[str, "_models.TelephonyCallPhase"], - started_at: datetime.datetime, - provider_call_id: Optional[str] = None, - caller_number: Optional[str] = None, - provider_number: Optional[str] = None, - answered_at: Optional[datetime.datetime] = None, - media_connected_at: Optional[datetime.datetime] = None, - agent_session_ready_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - duration_ms: Optional[datetime.timedelta] = None, - end_reason: Optional[Union[str, "_models.TelephonyCallEndReason"]] = None, - provider_status_code: Optional[int] = None, - provider_sub_code: Optional[int] = None, - provider_message: Optional[str] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -28311,115 +30797,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.APPLY_PATCH # type: ignore -class TelephonyCallTiming(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Detailed provider-neutral timing for an inbound telephony call. +class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox that stores reusable tool definitions for agents. - :ivar received_at: The Unix timestamp (in seconds) for when the provider webhook was received. - :vartype received_at: ~datetime.datetime - :ivar validated_at: The Unix timestamp (in seconds) for when webhook validation completed. - :vartype validated_at: ~datetime.datetime - :ivar admitted_at: The Unix timestamp (in seconds) for when the call was admitted to an agent - binding. - :vartype admitted_at: ~datetime.datetime - :ivar answer_requested_at: The Unix timestamp (in seconds) for when the service requested that - the provider answer the call. - :vartype answer_requested_at: ~datetime.datetime - :ivar answered_at: The Unix timestamp (in seconds) for when the provider reported that the call - was answered. - :vartype answered_at: ~datetime.datetime - :ivar media_connected_at: The Unix timestamp (in seconds) for when the provider media channel - connected. - :vartype media_connected_at: ~datetime.datetime - :ivar agent_session_ready_at: The Unix timestamp (in seconds) for when the voice-agent session - became ready. - :vartype agent_session_ready_at: ~datetime.datetime - :ivar first_caller_audio_at: The Unix timestamp (in seconds) for when caller audio was first - observed. - :vartype first_caller_audio_at: ~datetime.datetime - :ivar first_agent_audio_at: The Unix timestamp (in seconds) for when agent audio was first - observed. - :vartype first_agent_audio_at: ~datetime.datetime - :ivar ended_at: The Unix timestamp (in seconds) for when the call reached a terminal state. - :vartype ended_at: ~datetime.datetime - :ivar duration_basis: The timestamp used as the basis for duration. Known values are: - "answered" and "received". - :vartype duration_basis: str or ~azure.ai.projects.models.TelephonyCallDurationBasis - :ivar timestamp_source: The primary source of the timing milestones. Individual lifecycle - events identify their own timestamp source separately. Required. Known values are: "provider", - "gateway", and "derived". - :vartype timestamp_source: str or ~azure.ai.projects.models.TelephonyCallTimestampSource + :ivar id: The unique identifier of the toolbox. Required. + :vartype id: str + :ivar name: The name of the toolbox. Required. + :vartype name: str + :ivar updated_at: The Unix timestamp (seconds) when the toolbox was last updated. This value + changes when a new toolbox version is created or the toolbox is updated. Required. + :vartype updated_at: ~datetime.datetime + :ivar versions: The versions associated with the toolbox. Required. + :vartype versions: ~azure.ai.projects.models.ToolboxVersions + :ivar default_version: The version identifier that the toolbox currently points to. Defaults to + the latest version. Can be changed via updateToolbox. Required. + :vartype default_version: str """ - received_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider webhook was received.""" - validated_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when webhook validation completed.""" - admitted_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the call was admitted to an agent binding.""" - answer_requested_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the service requested that the provider answer the - call.""" - answered_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider reported that the call was answered.""" - media_connected_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the provider media channel connected.""" - agent_session_ready_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when the voice-agent session became ready.""" - first_caller_audio_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when caller audio was first observed.""" - first_agent_audio_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (in seconds) for when agent audio was first observed.""" - ended_at: Optional[datetime.datetime] = rest_field( + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the toolbox. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox. Required.""" + updated_at: datetime.datetime = rest_field( visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) - """The Unix timestamp (in seconds) for when the call reached a terminal state.""" - duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The timestamp used as the basis for duration. Known values are: \"answered\" and \"received\".""" - timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The primary source of the timing milestones. Individual lifecycle events identify their own - timestamp source separately. Required. Known values are: \"provider\", \"gateway\", and - \"derived\".""" + """The Unix timestamp (seconds) when the toolbox was last updated. This value changes when a new + toolbox version is created or the toolbox is updated. Required.""" + versions: "_models.ToolboxVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The versions associated with the toolbox. Required.""" + default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier that the toolbox currently points to. Defaults to the latest version. + Can be changed via updateToolbox. Required.""" @overload def __init__( self, *, - timestamp_source: Union[str, "_models.TelephonyCallTimestampSource"], - received_at: Optional[datetime.datetime] = None, - validated_at: Optional[datetime.datetime] = None, - admitted_at: Optional[datetime.datetime] = None, - answer_requested_at: Optional[datetime.datetime] = None, - answered_at: Optional[datetime.datetime] = None, - media_connected_at: Optional[datetime.datetime] = None, - agent_session_ready_at: Optional[datetime.datetime] = None, - first_caller_audio_at: Optional[datetime.datetime] = None, - first_agent_audio_at: Optional[datetime.datetime] = None, - ended_at: Optional[datetime.datetime] = None, - duration_basis: Optional[Union[str, "_models.TelephonyCallDurationBasis"]] = None, + id: str, # pylint: disable=redefined-builtin + name: str, + updated_at: datetime.datetime, + versions: "_models.ToolboxVersions", + default_version: str, ) -> None: ... @overload @@ -28433,50 +30854,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyCallTrace(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Correlation from a durable telephony call record to its customer-facing Foundry trace. +class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Policy configuration for a toolbox, including content safety and other governance settings. - :ivar status: The trace availability status. Required. Known values are: "pending", "emitting", - "available", "not_recorded", "not_applicable", and "failed". - :vartype status: str or ~azure.ai.projects.models.TelephonyCallTraceStatus - :ivar trace_id: The W3C trace identifier, when a trace was recorded. - :vartype trace_id: str - :ivar root_span_id: The root span identifier, when a trace was recorded. - :vartype root_span_id: str - :ivar conversation_id: The voice-agent conversation identifier, when a conversation was - created. - :vartype conversation_id: str - :ivar mode: Whether the trace was emitted live or after the call ended. Known values are: - "live" and "post_call". - :vartype mode: str or ~azure.ai.projects.models.TelephonyCallTraceMode + :ivar rai_config: Responsible AI content filtering configuration. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig """ - status: Union[str, "_models.TelephonyCallTraceStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The trace availability status. Required. Known values are: \"pending\", \"emitting\", - \"available\", \"not_recorded\", \"not_applicable\", and \"failed\".""" - trace_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The W3C trace identifier, when a trace was recorded.""" - root_span_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The root span identifier, when a trace was recorded.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The voice-agent conversation identifier, when a conversation was created.""" - mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the trace was emitted live or after the call ended. Known values are: \"live\" and - \"post_call\".""" + rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Responsible AI content filtering configuration.""" @overload def __init__( self, *, - status: Union[str, "_models.TelephonyCallTraceStatus"], - trace_id: Optional[str] = None, - root_span_id: Optional[str] = None, - conversation_id: Optional[str] = None, - mode: Optional[Union[str, "_models.TelephonyCallTraceMode"]] = None, + rai_config: Optional["_models.RaiConfig"] = None, ) -> None: ... @overload @@ -28490,30 +30882,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyOutboundDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The destination of an outbound call. +class ToolboxSearchPreviewToolboxTool( + ToolboxTool, discriminator="toolbox_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A toolbox search tool stored in a toolbox. - :ivar type: The destination type. Only E.164 phone numbers are currently supported. Required. - "phone_number" - :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundDestinationType - :ivar value: The destination E.164 phone number. Required. - :vartype value: str + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. + TOOLBOX_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH_PREVIEW """ - type: Union[str, "_models.TelephonyOutboundDestinationType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The destination type. Only E.164 phone numbers are currently supported. Required. - \"phone_number\"""" - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The destination E.164 phone number. Required.""" + type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" @overload def __init__( self, *, - type: Union[str, "_models.TelephonyOutboundDestinationType"], - value: str, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -28525,36 +30921,88 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolboxToolType.TOOLBOX_SEARCH_PREVIEW # type: ignore -class TelephonyOutboundRetryPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The retry policy for one durable outbound call intent. ``max_attempts`` includes the first - attempt. Strategy-specific settings are defined by the derived policy. +class ToolboxShellEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An execution environment for a shell tool stored in a toolbox. This environment model is scoped + to toolbox configuration and does not modify the OpenAI shell environment contract. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TelephonyOutboundFixedIntervalRetryPolicy + ToolboxShellContainerAutoEnvironment, ToolboxShellContainerReferenceEnvironment - :ivar type: The retry strategy. Only fixed-interval retries are currently supported. Required. - "fixed_interval" - :vartype type: str or ~azure.ai.projects.models.TelephonyOutboundRetryPolicyType - :ivar max_attempts: The maximum number of provider attempts, including the first attempt. - Defaults to 1. - :vartype max_attempts: int + :ivar type: The type of the shell execution environment. Required. Default value is None. + :vartype type: str """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The retry strategy. Only fixed-interval retries are currently supported. Required. - \"fixed_interval\"""" - max_attempts: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of provider attempts, including the first attempt. Defaults to 1.""" + """The type of the shell execution environment. Required. Default value is None.""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ToolboxShellContainerAutoEnvironment( + ToolboxShellEnvironment, discriminator="container_auto" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """An automatically provisioned container environment for a shell tool stored in a toolbox. + + :ivar type: The type of the shell execution environment. Always ``container_auto``. Required. + Default value is "container_auto". + :vartype type: str + :ivar file_ids: An optional list of uploaded files to make available to your code. + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: str or ~azure.ai.projects.models.ContainerMemoryLimit + :ivar skills: An optional list of skills referenced by id or inline data. + :vartype skills: list[~azure.ai.projects.models.ContainerSkill] + :ivar network_policy: The network access policy for the container. When omitted, the service + defaults to disabled outbound network access. + :vartype network_policy: ~azure.ai.projects.models.ToolboxShellNetworkPolicy + """ + + type: Literal["container_auto"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell execution environment. Always ``container_auto``. Required. Default value + is \"container_auto\".""" + file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + skills: Optional[list["_models.ContainerSkill"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An optional list of skills referenced by id or inline data.""" + network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The network access policy for the container. When omitted, the service defaults to disabled + outbound network access.""" @overload def __init__( self, *, - type: str, - max_attempts: Optional[int] = None, + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, + skills: Optional[list["_models.ContainerSkill"]] = None, + network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = None, ) -> None: ... @overload @@ -28566,36 +31014,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "container_auto" # type: ignore -class TelephonyOutboundFixedIntervalRetryPolicy( - TelephonyOutboundRetryPolicy, discriminator="fixed_interval" +class ToolboxShellContainerReferenceEnvironment( + ToolboxShellEnvironment, discriminator="container_reference" ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The frozen fixed-interval retry policy returned for an outbound call or campaign. + """An existing container environment for a shell tool stored in a toolbox. - :ivar max_attempts: The maximum number of provider attempts, including the first attempt. - Defaults to 1. - :vartype max_attempts: int - :ivar type: The fixed-interval retry strategy. Required. Retry after a fixed interval between - attempts. - :vartype type: str or ~azure.ai.projects.models.FIXED_INTERVAL - :ivar interval: The fixed delay in seconds between attempts. Required. - :vartype interval: ~datetime.timedelta + :ivar type: The type of the shell execution environment. Always ``container_reference``. + Required. Default value is "container_reference". + :vartype type: str + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str """ - type: Literal[TelephonyOutboundRetryPolicyType.FIXED_INTERVAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The fixed-interval retry strategy. Required. Retry after a fixed interval between attempts.""" - interval: datetime.timedelta = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="duration-seconds-int" - ) - """The fixed delay in seconds between attempts. Required.""" + type: Literal["container_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell execution environment. Always ``container_reference``. Required. Default + value is \"container_reference\".""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the referenced container. Required.""" @overload def __init__( self, *, - interval: datetime.timedelta, - max_attempts: Optional[int] = None, + container_id: str, ) -> None: ... @overload @@ -28607,37 +31051,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TelephonyOutboundRetryPolicyType.FIXED_INTERVAL # type: ignore + self.type = "container_reference" # type: ignore -class TelephonyTransferTarget(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A named destination to which the voice agent may transfer a call. +class ToolboxShellNetworkPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network access policy for an automatically provisioned toolbox shell container. - :ivar name: The unique name exposed to the voice agent for this transfer target. Required. - :vartype name: str - :ivar description: A description that helps the voice agent decide when to use this target. - Required. - :vartype description: str - :ivar destination: The provider-specific transfer destination. Required. - :vartype destination: ~azure.ai.projects.models.TelephonyTransferDestination + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolboxShellNetworkPolicyDisabled + + :ivar type: The type of network access policy. Required. Default value is None. + :vartype type: str """ - name: str = rest_field(visibility=["read", "create"]) - """The unique name exposed to the voice agent for this transfer target. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description that helps the voice agent decide when to use this target. Required.""" - destination: "_models.TelephonyTransferDestination" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provider-specific transfer destination. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of network access policy. Required. Default value is None.""" @overload def __init__( self, *, - name: str, - description: str, - destination: "_models.TelephonyTransferDestination", + type: str, ) -> None: ... @overload @@ -28651,25 +31086,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyTransferTargets(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The telephony transfer targets configured for one voice agent. +class ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator="disabled"): + """A network policy that disables outbound access from a toolbox shell container. - :ivar transfer_targets: The complete set of destinations to which the voice agent may transfer - calls. An empty array clears all targets when replacing the configuration. Required. - :vartype transfer_targets: list[~azure.ai.projects.models.TelephonyTransferTarget] + :ivar type: The type of network access policy. Always ``disabled``. Required. Default value is + "disabled". + :vartype type: str """ - transfer_targets: list["_models.TelephonyTransferTarget"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The complete set of destinations to which the voice agent may transfer calls. An empty array - clears all targets when replacing the configuration. Required.""" + type: Literal["disabled"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of network access policy. Always ``disabled``. Required. Default value is + \"disabled\".""" @overload def __init__( self, - *, - transfer_targets: list["_models.TelephonyTransferTarget"], ) -> None: ... @overload @@ -28681,28 +31112,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "disabled" # type: ignore -class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An object specifying the format that the model must output. Configuring ``{ "type": - "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied - JSON schema. Learn more in the `Structured Outputs guide - `_. The default format is ``{ - "type": "text" }`` with no additional options. *Not recommended for gpt-4o and newer models:** - Setting to ``{ "type": "json_object" }`` enables the older JSON mode, which ensures the message - the model generates is valid JSON. Using ``json_schema`` is preferred for models that support - it. +class ToolboxSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A skill source included in a toolbox. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText + ToolboxSkillReference - :ivar type: Required. Known values are: "text", "json_schema", and "json_object". - :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType + :ivar type: The type of skill source. Required. Default value is None. + :vartype type: str """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"text\", \"json_schema\", and \"json_object\".""" + """The type of skill source. Required. Default value is None.""" @overload def __init__( @@ -28722,20 +31147,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TextResponseFormatJsonObject(TextResponseFormat, discriminator="json_object"): - """JSON object. +class ToolboxSkillReference( + ToolboxSkill, discriminator="skill_reference" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to an existing skill to include in a toolbox. - :ivar type: The type of response format being defined. Always ``json_object``. Required. - JSON_OBJECT. - :vartype type: str or ~azure.ai.projects.models.JSON_OBJECT + :ivar type: The type of skill source. Required. Default value is "skill_reference". + :vartype type: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar version: The version of the skill. If not specified, the skill's default version is used. + When a version is specified, the reference is pinned to that immutable version. + :vartype version: str """ - type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" + type: Literal["skill_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of skill source. Required. Default value is \"skill_reference\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the skill. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the skill. If not specified, the skill's default version is used. When a version + is specified, the reference is pinned to that immutable version.""" @overload def __init__( self, + *, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -28747,49 +31186,82 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TextResponseFormatConfigurationType.JSON_OBJECT # type: ignore + self.type = "skill_reference" # type: ignore -class TextResponseFormatJsonSchema( - TextResponseFormat, discriminator="json_schema" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """JSON schema. +class ToolboxVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A specific version of a toolbox. - :ivar type: The type of response format being defined. Always ``json_schema``. Required. - JSON_SCHEMA. - :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA - :ivar description: A description of what the response format is for, used by the model to - determine how to respond in the format. - :vartype description: str - :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and - dashes, with a maximum length of 64. Required. + :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. Required. + :vartype metadata: dict[str, str] + :ivar id: The unique identifier of the toolbox version. Required. + :vartype id: str + :ivar name: The name of the toolbox. Required. :vartype name: str - :ivar schema: Required. - :vartype schema: dict[str, any] - :ivar strict: - :vartype strict: bool + :ivar version: The version identifier of the toolbox. Toolbox versions are immutable and every + update creates a new version. Required. + :vartype version: str + :ivar description: A human-readable description of the toolbox. + :vartype description: str + :ivar created_at: The Unix timestamp (seconds) when the toolbox version was created. Required. + :vartype created_at: ~datetime.datetime + :ivar tools: The list of tools contained in this toolbox version. Required. + :vartype tools: list[~azure.ai.projects.models.ToolboxTool] + :ivar skills: The list of skill sources included in this toolbox version. + :vartype skills: list[~azure.ai.projects.models.ToolboxSkill] + :ivar policies: Policy configuration for the toolbox version. + :vartype policies: ~azure.ai.projects.models.ToolboxPolicies """ - type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the response format is for, used by the model to determine how to respond - in the format.""" + metadata: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the toolbox version. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with - a maximum length of 64. Required.""" - schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the toolbox. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version identifier of the toolbox. Toolbox versions are immutable and every update creates + a new version. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the toolbox.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the toolbox version was created. Required.""" + tools: list["_models.ToolboxTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of tools contained in this toolbox version. Required.""" + skills: Optional[list["_models.ToolboxSkill"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of skill sources included in this toolbox version.""" + policies: Optional["_models.ToolboxPolicies"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Policy configuration for the toolbox version.""" @overload def __init__( self, *, + metadata: dict[str, str], + id: str, # pylint: disable=redefined-builtin name: str, - schema: dict[str, Any], + version: str, + created_at: datetime.datetime, + tools: list["_models.ToolboxTool"], description: Optional[str] = None, - strict: Optional[bool] = None, + skills: Optional[list["_models.ToolboxSkill"]] = None, + policies: Optional["_models.ToolboxPolicies"] = None, ) -> None: ... @overload @@ -28801,22 +31273,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore -class TextResponseFormatText(TextResponseFormat, discriminator="text"): - """Text. +class ToolboxVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The versions associated with a toolbox. - :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. - :vartype type: str or ~azure.ai.projects.models.TEXT + :ivar latest: The latest version of the toolbox. Required. + :vartype latest: ~azure.ai.projects.models.ToolboxVersionObject """ - type: Literal[TextResponseFormatConfigurationType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of response format being defined. Always ``text``. Required. TEXT.""" + latest: "_models.ToolboxVersionObject" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The latest version of the toolbox. Required.""" @overload def __init__( self, + *, + latest: "_models.ToolboxVersionObject", ) -> None: ... @overload @@ -28828,32 +31301,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TextResponseFormatConfigurationType.TEXT # type: ignore -class TimerRoutineTrigger( - RoutineTrigger, discriminator="timer" +class ToolChoiceAllowed( + ToolChoiceParam, discriminator="allowed_tools" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """A one-shot timer routine trigger. + """Allowed tools. - :ivar type: The trigger type. Required. A one-shot timer trigger. - :vartype type: str or ~azure.ai.projects.models.TIMER - :ivar at: The UTC date and time at which the timer fires. - :vartype at: ~datetime.datetime + :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. + :vartype type: str or ~azure.ai.projects.models.ALLOWED_TOOLS + :ivar mode: Constrains the tools available to the model to a pre-defined set. ``auto`` allows + the model to pick from among the allowed tools and generate a message. ``required`` requires + the model to call one or more of the allowed tools. Required. Is either a Literal["auto"] type + or a Literal["required"] type. + :vartype mode: str or str + :ivar tools: Required. A list of tool definitions that the model should be allowed to call. For + the Responses API, the list of tool definitions might look like: + + .. code-block:: json + + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + :vartype tools: list[dict[str, any]] """ - type: Literal[RoutineTriggerType.TIMER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The trigger type. Required. A one-shot timer trigger.""" - at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The UTC date and time at which the timer fires.""" + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" + mode: Literal["auto", "required"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Constrains the tools available to the model to a pre-defined set. ``auto`` allows the model to + pick from among the allowed tools and generate a message. ``required`` requires the model to + call one or more of the allowed tools. Required. Is either a Literal[\"auto\"] type or a + Literal[\"required\"] type.""" + tools: list[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. A list of tool definitions that the model should be allowed to call. For the + Responses API, the list of tool definitions might look like: + + .. code-block:: json + + [ + { \"type\": \"function\", \"name\": \"get_weather\" }, + { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, + { \"type\": \"image_generation\" } + ]""" @overload def __init__( self, *, - at: Optional[datetime.datetime] = None, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]], ) -> None: ... @overload @@ -28865,50 +31364,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RoutineTriggerType.TIMER # type: ignore + self.type = ToolChoiceParamType.ALLOWED_TOOLS # type: ignore -class ToolboxObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox that stores reusable tool definitions for agents. +class ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator="code_interpreter"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar id: The unique identifier of the toolbox. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. - :vartype name: str - :ivar updated_at: The Unix timestamp (seconds) when the toolbox was last updated. This value - changes when a new toolbox version is created or the toolbox is updated. Required. - :vartype updated_at: ~datetime.datetime - :ivar versions: The versions associated with the toolbox. Required. - :vartype versions: ~azure.ai.projects.models.ToolboxVersions - :ivar default_version: The version identifier that the toolbox currently points to. Defaults to - the latest version. Can be changed via updateToolbox. Required. - :vartype default_version: str + :ivar type: Required. CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the toolbox. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the toolbox. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the toolbox was last updated. This value changes when a new - toolbox version is created or the toolbox is updated. Required.""" - versions: "_models.ToolboxVersions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The versions associated with the toolbox. Required.""" - default_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier that the toolbox currently points to. Defaults to the latest version. - Can be changed via updateToolbox. Required.""" + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. CODE_INTERPRETER.""" @overload def __init__( self, - *, - id: str, # pylint: disable=redefined-builtin - name: str, - updated_at: datetime.datetime, - versions: "_models.ToolboxVersions", - default_version: str, ) -> None: ... @overload @@ -28920,23 +31392,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore -class ToolboxPolicies(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Policy configuration for a toolbox, including content safety and other governance settings. +class ToolChoiceComputer(ToolChoiceParam, discriminator="computer"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar rai_config: Responsible AI content filtering configuration. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar type: Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER """ - rai_config: Optional["_models.RaiConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Responsible AI content filtering configuration.""" + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER.""" @overload def __init__( self, - *, - rai_config: Optional["_models.RaiConfig"] = None, ) -> None: ... @overload @@ -28948,36 +31420,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.COMPUTER # type: ignore -class ToolboxSearchPreviewToolboxTool( - ToolboxTool, discriminator="toolbox_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A toolbox search tool stored in a toolbox. +class ToolChoiceComputerUse(ToolChoiceParam, discriminator="computer_use"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar name: Optional user-defined name for this tool or configuration. - :vartype name: str - :ivar description: Optional user-defined description for this tool or configuration. - :vartype description: str - :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all - default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names - are silently ignored at runtime. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. - TOOLBOX_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.TOOLBOX_SEARCH_PREVIEW + :ivar type: Required. COMPUTER_USE. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE """ - type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" + type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE.""" @overload def __init__( self, - *, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -28989,29 +31448,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolboxToolType.TOOLBOX_SEARCH_PREVIEW # type: ignore - + self.type = ToolChoiceParamType.COMPUTER_USE # type: ignore -class ToolboxShellEnvironment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An execution environment for a shell tool stored in a toolbox. This environment model is scoped - to toolbox configuration and does not modify the OpenAI shell environment contract. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxShellContainerAutoEnvironment, ToolboxShellContainerReferenceEnvironment +class ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator="computer_use_preview"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar type: The type of the shell execution environment. Required. Default value is None. - :vartype type: str + :ivar type: Required. COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the shell execution environment. Required. Default value is None.""" + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE_PREVIEW.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -29023,54 +31476,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.COMPUTER_USE_PREVIEW # type: ignore -class ToolboxShellContainerAutoEnvironment( - ToolboxShellEnvironment, discriminator="container_auto" +class ToolChoiceCustom( + ToolChoiceParam, discriminator="custom" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """An automatically provisioned container environment for a shell tool stored in a toolbox. + """Custom tool. - :ivar type: The type of the shell execution environment. Always ``container_auto``. Required. - Default value is "container_auto". - :vartype type: str - :ivar file_ids: An optional list of uploaded files to make available to your code. - :vartype file_ids: list[str] - :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". - :vartype memory_limit: str or ~azure.ai.projects.models.ContainerMemoryLimit - :ivar skills: An optional list of skills referenced by id or inline data. - :vartype skills: list[~azure.ai.projects.models.ContainerSkill] - :ivar network_policy: The network access policy for the container. When omitted, the service - defaults to disabled outbound network access. - :vartype network_policy: ~azure.ai.projects.models.ToolboxShellNetworkPolicy + :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar name: The name of the custom tool to call. Required. + :vartype name: str """ - type: Literal["container_auto"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell execution environment. Always ``container_auto``. Required. Default value - is \"container_auto\".""" - file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional list of uploaded files to make available to your code.""" - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" - skills: Optional[list["_models.ContainerSkill"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """An optional list of skills referenced by id or inline data.""" - network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The network access policy for the container. When omitted, the service defaults to disabled - outbound network access.""" + type: Literal[ToolChoiceParamType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool to call. Required.""" @overload def __init__( self, *, - file_ids: Optional[list[str]] = None, - memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, - skills: Optional[list["_models.ContainerSkill"]] = None, - network_policy: Optional["_models.ToolboxShellNetworkPolicy"] = None, + name: str, ) -> None: ... @overload @@ -29082,32 +31511,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "container_auto" # type: ignore + self.type = ToolChoiceParamType.CUSTOM # type: ignore -class ToolboxShellContainerReferenceEnvironment( - ToolboxShellEnvironment, discriminator="container_reference" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """An existing container environment for a shell tool stored in a toolbox. +class ToolChoiceFileSearch(ToolChoiceParam, discriminator="file_search"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar type: The type of the shell execution environment. Always ``container_reference``. - Required. Default value is "container_reference". - :vartype type: str - :ivar container_id: The ID of the referenced container. Required. - :vartype container_id: str + :ivar type: Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH """ - type: Literal["container_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell execution environment. Always ``container_reference``. Required. Default - value is \"container_reference\".""" - container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the referenced container. Required.""" + type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. FILE_SEARCH.""" @overload def __init__( self, - *, - container_id: str, ) -> None: ... @overload @@ -29119,28 +31539,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "container_reference" # type: ignore - + self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore -class ToolboxShellNetworkPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Network access policy for an automatically provisioned toolbox shell container. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxShellNetworkPolicyDisabled +class ToolChoiceFunction( + ToolChoiceParam, discriminator="function" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function tool. - :ivar type: The type of network access policy. Required. Default value is None. - :vartype type: str + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: str or ~azure.ai.projects.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of network access policy. Required. Default value is None.""" + type: Literal[ToolChoiceParamType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to call. Required.""" @overload def __init__( self, *, - type: str, + name: str, ) -> None: ... @overload @@ -29152,19 +31574,19 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.FUNCTION # type: ignore -class ToolboxShellNetworkPolicyDisabled(ToolboxShellNetworkPolicy, discriminator="disabled"): - """A network policy that disables outbound access from a toolbox shell container. +class ToolChoiceImageGeneration(ToolChoiceParam, discriminator="image_generation"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar type: The type of network access policy. Always ``disabled``. Required. Default value is - "disabled". - :vartype type: str + :ivar type: Required. IMAGE_GENERATION. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION """ - type: Literal["disabled"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of network access policy. Always ``disabled``. Required. Default value is - \"disabled\".""" + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. IMAGE_GENERATION.""" @overload def __init__( @@ -29180,28 +31602,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "disabled" # type: ignore - + self.type = ToolChoiceParamType.IMAGE_GENERATION # type: ignore -class ToolboxSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A skill source included in a toolbox. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolboxSkillReference +class ToolChoiceMCP( + ToolChoiceParam, discriminator="mcp" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. - :ivar type: The type of skill source. Required. Default value is None. - :vartype type: str + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: + :vartype name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of skill source. Required. Default value is None.""" + type: Literal[ToolChoiceParamType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For MCP tools, the type is always ``mcp``. Required. MCP.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server to use. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: str, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -29213,36 +31641,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.MCP # type: ignore -class ToolboxSkillReference( - ToolboxSkill, discriminator="skill_reference" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """A reference to an existing skill to include in a toolbox. +class ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator="web_search_preview"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - :ivar type: The type of skill source. Required. Default value is "skill_reference". - :vartype type: str - :ivar name: The name of the skill. Required. - :vartype name: str - :ivar version: The version of the skill. If not specified, the skill's default version is used. - When a version is specified, the reference is pinned to that immutable version. - :vartype version: str + :ivar type: Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW """ - type: Literal["skill_reference"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of skill source. Required. Default value is \"skill_reference\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the skill. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the skill. If not specified, the skill's default version is used. When a version - is specified, the reference is pinned to that immutable version.""" + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW.""" @overload def __init__( self, - *, - name: str, - version: Optional[str] = None, ) -> None: ... @overload @@ -29254,82 +31669,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "skill_reference" # type: ignore - + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW # type: ignore -class ToolboxVersionObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A specific version of a toolbox. - :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. +class ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator="web_search_preview_2025_03_11"): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Required. - :vartype metadata: dict[str, str] - :ivar id: The unique identifier of the toolbox version. Required. - :vartype id: str - :ivar name: The name of the toolbox. Required. - :vartype name: str - :ivar version: The version identifier of the toolbox. Toolbox versions are immutable and every - update creates a new version. Required. - :vartype version: str - :ivar description: A human-readable description of the toolbox. - :vartype description: str - :ivar created_at: The Unix timestamp (seconds) when the toolbox version was created. Required. - :vartype created_at: ~datetime.datetime - :ivar tools: The list of tools contained in this toolbox version. Required. - :vartype tools: list[~azure.ai.projects.models.ToolboxTool] - :ivar skills: The list of skill sources included in this toolbox version. - :vartype skills: list[~azure.ai.projects.models.ToolboxSkill] - :ivar policies: Policy configuration for the toolbox version. - :vartype policies: ~azure.ai.projects.models.ToolboxPolicies + :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 """ - metadata: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Required.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the toolbox version. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the toolbox. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version identifier of the toolbox. Toolbox versions are immutable and every update creates - a new version. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the toolbox.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the toolbox version was created. Required.""" - tools: list["_models.ToolboxTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The list of tools contained in this toolbox version. Required.""" - skills: Optional[list["_models.ToolboxSkill"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of skill sources included in this toolbox version.""" - policies: Optional["_models.ToolboxPolicies"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Policy configuration for the toolbox version.""" + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" @overload def __init__( self, - *, - metadata: dict[str, str], - id: str, # pylint: disable=redefined-builtin - name: str, - version: str, - created_at: datetime.datetime, - tools: list["_models.ToolboxTool"], - description: Optional[str] = None, - skills: Optional[list["_models.ToolboxSkill"]] = None, - policies: Optional["_models.ToolboxPolicies"] = None, ) -> None: ... @overload @@ -29341,23 +31697,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore -class ToolboxVersions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The versions associated with a toolbox. +class ToolCodeInterpreterTool( + Tool, discriminator="code_interpreter" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Code interpreter. - :ivar latest: The latest version of the toolbox. Required. - :vartype latest: ~azure.ai.projects.models.ToolboxVersionObject + :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. + CODE_INTERPRETER. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar container: The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an optional + ``memory_limit`` setting. If not provided, the service assumes auto. Is either a str type or a + AutoCodeInterpreterToolParam type. + :vartype container: str or ~azure.ai.projects.models.AutoCodeInterpreterToolParam + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - latest: "_models.ToolboxVersionObject" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The latest version of the toolbox. Required.""" + type: Literal[ToolType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The code interpreter container. Can be a container ID or an object that specifies uploaded file + IDs to make available to your code, along with an optional ``memory_limit`` setting. If not + provided, the service assumes auto. Is either a str type or a AutoCodeInterpreterToolParam + type.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - latest: "_models.ToolboxVersionObject", + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + container: Optional[Union[str, "_models.AutoCodeInterpreterToolParam"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -29369,58 +31766,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.CODE_INTERPRETER # type: ignore -class ToolChoiceAllowed( - ToolChoiceParam, discriminator="allowed_tools" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Allowed tools. - - :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. - :vartype type: str or ~azure.ai.projects.models.ALLOWED_TOOLS - :ivar mode: Constrains the tools available to the model to a pre-defined set. ``auto`` allows - the model to pick from among the allowed tools and generate a message. ``required`` requires - the model to call one or more of the allowed tools. Required. Is either a Literal["auto"] type - or a Literal["required"] type. - :vartype mode: str or str - :ivar tools: Required. A list of tool definitions that the model should be allowed to call. For - the Responses API, the list of tool definitions might look like: - - .. code-block:: json +class ToolComputerTool(Tool, discriminator="computer"): + """Computer. - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - :vartype tools: list[dict[str, any]] + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER """ - type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" - mode: Literal["auto", "required"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Constrains the tools available to the model to a pre-defined set. ``auto`` allows the model to - pick from among the allowed tools and generate a message. ``required`` requires the model to - call one or more of the allowed tools. Required. Is either a Literal[\"auto\"] type or a - Literal[\"required\"] type.""" - tools: list[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. A list of tool definitions that the model should be allowed to call. For the - Responses API, the list of tool definitions might look like: - - .. code-block:: json - - [ - { \"type\": \"function\", \"name\": \"get_weather\" }, - { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, - { \"type\": \"image_generation\" } - ]""" + type: Literal[ToolType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" @overload def __init__( self, - *, - mode: Literal["auto", "required"], - tools: list[dict[str, Any]], ) -> None: ... @overload @@ -29432,23 +31793,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.ALLOWED_TOOLS # type: ignore + self.type = ToolType.COMPUTER # type: ignore -class ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator="code_interpreter"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolComputerUsePreviewTool( + Tool, discriminator="computer_use_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Computer use preview. - :ivar type: Required. CODE_INTERPRETER. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + :ivar environment: The type of computer environment to control. Required. Known values are: + "windows", "mac", "linux", "ubuntu", and "browser". + :vartype environment: str or ~azure.ai.projects.models.ComputerEnvironment + :ivar display_width: The width of the computer display. Required. + :vartype display_width: int + :ivar display_height: The height of the computer display. Required. + :vartype display_height: int """ - type: Literal[ToolChoiceParamType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CODE_INTERPRETER.""" + type: Literal[ToolType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW.""" + environment: Union[str, "_models.ComputerEnvironment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", + \"linux\", \"ubuntu\", and \"browser\".""" + display_width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The width of the computer display. Required.""" + display_height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The height of the computer display. Required.""" @overload def __init__( self, + *, + environment: Union[str, "_models.ComputerEnvironment"], + display_width: int, + display_height: int, ) -> None: ... @overload @@ -29460,23 +31844,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore + self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class ToolChoiceComputer(ToolChoiceParam, discriminator="computer"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Per-tool configuration that controls tool visibility and search behavior. - :ivar type: Required. COMPUTER. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + :ivar pin: When true, the tool is always included in agent context and visible in + ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only + discoverable via ``tool_search``. + :vartype pin: bool + :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native + tool description to improve discoverability. Does not alter ``tools/list`` output. + :vartype additional_search_text: str """ - type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER.""" + pin: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """When true, the tool is always included in agent context and visible in ``tools/list``. When + false (default), the tool is hidden from ``tools/list`` and only discoverable via + ``tool_search``.""" + additional_search_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional text indexed for tool_search. Supplements the native tool description to improve + discoverability. Does not alter ``tools/list`` output.""" @overload def __init__( self, + *, + pin: Optional[bool] = None, + additional_search_text: Optional[str] = None, ) -> None: ... @overload @@ -29488,23 +31884,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.COMPUTER # type: ignore -class ToolChoiceComputerUse(ToolChoiceParam, discriminator="computer_use"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolCustomToolParam(Tool, discriminator="custom"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom tool. - :ivar type: Required. COMPUTER_USE. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE + :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar name: The name of the custom tool, used to identify it in tool calls. Required. + :vartype name: str + :ivar async_property: Whether the tool response can be returned asynchronously versus + immediately returned on next response creation. + :vartype async_property: bool + :ivar description: Optional description of the custom tool, used to provide more context. + :vartype description: str + :ivar format: The input format for the custom tool. Default is unconstrained text. + :vartype format: ~azure.ai.projects.models.CustomToolParamFormat + :ivar defer_loading: Whether this tool should be deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] """ - type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE.""" + type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool, used to identify it in tool calls. Required.""" + async_property: Optional[bool] = rest_field( + name="async", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the tool response can be returned asynchronously versus immediately returned on next + response creation.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the custom tool, used to provide more context.""" + format: Optional["_models.CustomToolParamFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input format for the custom tool. Default is unconstrained text.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this tool should be deferred and discovered via tool search.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, + *, + name: str, + async_property: Optional[bool] = None, + description: Optional[str] = None, + format: Optional["_models.CustomToolParamFormat"] = None, + defer_loading: Optional[bool] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -29516,23 +31948,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.COMPUTER_USE # type: ignore + self.type = ToolType.CUSTOM # type: ignore -class ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator="computer_use_preview"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Description of a tool that can be used by an agent. - :ivar type: Required. COMPUTER_USE_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + :ivar name: The name of the tool. + :vartype name: str + :ivar description: A brief description of the tool's purpose. + :vartype description: str """ - type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. COMPUTER_USE_PREVIEW.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A brief description of the tool's purpose.""" @overload def __init__( self, + *, + name: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -29544,30 +31982,67 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.COMPUTER_USE_PREVIEW # type: ignore -class ToolChoiceCustom( - ToolChoiceParam, discriminator="custom" +class ToolFileSearchTool( + Tool, discriminator="file_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Custom tool. + """File search. - :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. - :vartype type: str or ~azure.ai.projects.models.CUSTOM - :ivar name: The name of the custom tool to call. Required. + :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :ivar vector_store_ids: The IDs of the vector stores to search. Required. + :vartype vector_store_ids: list[str] + :ivar max_num_results: The maximum number of results to return. This number should be between 1 + and 50 inclusive. + :vartype max_num_results: int + :ivar ranking_options: Ranking options for search. + :vartype ranking_options: ~azure.ai.projects.models.RankingOptions + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. + :vartype filters: ~azure.ai.projects.models.ComparisonFilter or + ~azure.ai.projects.models.CompoundFilter + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal[ToolChoiceParamType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the custom tool to call. Required.""" + type: Literal[ToolType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" + vector_store_ids: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IDs of the vector stores to search. Required.""" + max_num_results: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" + ranking_options: Optional["_models.RankingOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ranking options for search.""" + filters: Optional["_unions.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is either a ComparisonFilter type or a CompoundFilter type.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - name: str, + vector_store_ids: list[str], + max_num_results: Optional[int] = None, + ranking_options: Optional["_models.RankingOptions"] = None, + filters: Optional["_unions.Filters"] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -29579,23 +32054,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.CUSTOM # type: ignore + self.type = ToolType.FILE_SEARCH # type: ignore -class ToolChoiceFileSearch(ToolChoiceParam, discriminator="file_search"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolFunctionShellToolParam( + Tool, discriminator="shell" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Shell tool. - :ivar type: Required. FILE_SEARCH. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH + :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. + :vartype type: str or ~azure.ai.projects.models.SHELL + :ivar environment: + :vartype environment: ~azure.ai.projects.models.FunctionShellToolParamEnvironment + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FILE_SEARCH.""" + type: Literal[ToolType.SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell tool. Always ``shell``. Required. SHELL.""" + environment: Optional["_models.FunctionShellToolParamEnvironment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, + *, + environment: Optional["_models.FunctionShellToolParamEnvironment"] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -29607,30 +32115,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore + self.type = ToolType.SHELL # type: ignore -class ToolChoiceFunction( - ToolChoiceParam, discriminator="function" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Function tool. +class ToolFunctionTool(Tool, discriminator="function"): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function. - :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. :vartype type: str or ~azure.ai.projects.models.FUNCTION :ivar name: The name of the function to call. Required. :vartype name: str + :ivar async_property: + :vartype async_property: bool + :ivar description: + :vartype description: str + :ivar parameters: Required. + :vartype parameters: dict[str, any] + :ivar output_schema: + :vartype output_schema: dict[str, any] + :ivar strict: Required. + :vartype strict: bool + :ivar defer_loading: Whether this function is deferred and loaded via tool search. + :vartype defer_loading: bool + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] """ - type: Literal[ToolChoiceParamType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """For function calling, the type is always ``function``. Required. FUNCTION.""" + type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the function tool. Always ``function``. Required. FUNCTION.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the function to call. Required.""" + async_property: Optional[bool] = rest_field( + name="async", visibility=["read", "create", "update", "delete", "query"] + ) + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + output_schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function is deferred and loaded via tool search.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, name: str, + parameters: dict[str, Any], + strict: bool, + async_property: Optional[bool] = None, + description: Optional[str] = None, + output_schema: Optional[dict[str, Any]] = None, + defer_loading: Optional[bool] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, ) -> None: ... @overload @@ -29642,23 +32183,199 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.FUNCTION # type: ignore + self.type = ToolType.FUNCTION # type: ignore -class ToolChoiceImageGeneration(ToolChoiceParam, discriminator="image_generation"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. +class ToolImageGenTool( + Tool, discriminator="image_generation" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Image generation tool. - :ivar type: Required. IMAGE_GENERATION. + :ivar type: The type of the image generation tool. Always ``image_generation``. Required. + IMAGE_GENERATION. :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION + :ivar model: Is one of the following types: Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], + Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], str + :vartype model: str or str or str or str or str or str or str or str or str or str + :ivar quality: The quality of the generated image. The GPT image models support ``low``, + ``medium``, and ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one + of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"], + Literal["max"], Literal["auto"] + :vartype quality: str or str or str or str or str or str + :ivar size: The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. Is one of the following types: Literal["1024x1024"], + Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str + :vartype size: str or str or str or str or str + :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or + ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], + Literal["jpeg"] + :vartype output_format: str or str or str + :ivar output_compression: Compression level for the output image. Default: 100. + :vartype output_compression: int + :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a + Literal["auto"] type or a Literal["low"] type. + :vartype moderation: str or str + :ivar background: Set the background of the generated image. One of ``transparent``, + ``opaque``, or ``auto``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including + their ``2026-09-08`` snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent + backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the + output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: + Literal["transparent"], Literal["opaque"], Literal["auto"] + :vartype background: str or str or str + :ivar input_fidelity: Known values are: "high" and "low". + :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity + :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) + and ``file_id`` (string, optional). + :vartype input_image_mask: ~azure.ai.projects.models.ImageGenToolInputImageMask + :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default + value) to 3. + :vartype partial_images: int + :ivar action: Whether to generate a new image or edit an existing image. Default: ``auto``. + Known values are: "generate", "edit", and "auto". + :vartype action: str or ~azure.ai.projects.models.ImageGenAction + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. IMAGE_GENERATION.""" + type: Literal[ToolType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" + model: Optional[ + Union[ + Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], + Literal["gpt-image-1.5"], + Literal["gpt-image-2"], + Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], + str, + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], + Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], + Literal[\"gpt-image-2.5-sunburst\"], Literal[\"gpt-image-2.5-sunburst-2026-09-08\"], + Literal[\"gpt-image-2.5-flare\"], Literal[\"gpt-image-2.5-flare-2026-09-08\"], str""" + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The quality of the generated image. The GPT image models support ``low``, ``medium``, and + ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their + ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one of the + following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"], + Literal[\"max\"], Literal[\"auto\"]""" + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, + ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and + ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` + strings, for example ``1536x864``. Width and height must both be divisible by 16 and the + requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are + experimental, and the maximum supported resolution is ``3840x2160``. The requested size must + also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, + ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported + for models that allow automatic sizing. Is one of the following types: Literal[\"1024x1024\"], + Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" + output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: + ``png``. Is one of the following types: Literal[\"png\"], Literal[\"webp\"], Literal[\"jpeg\"]""" + output_compression: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compression level for the output image. Default: 100.""" + moderation: Optional[Literal["auto", "low"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type + or a Literal[\"low\"] type.""" + background: Optional[Literal["transparent", "opaque", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. + ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their ``2026-09-08`` + snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent backgrounds are + available for supported GPT Image models. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, + this support is in preview. When using ``transparent``, set the output format to ``png`` or + ``webp``. Default: ``auto``. Is one of the following types: Literal[\"transparent\"], + Literal[\"opaque\"], Literal[\"auto\"]""" + input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"high\" and \"low\".""" + input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` + (string, optional).""" + partial_images: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" + action: Optional[Union[str, "_models.ImageGenAction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: + \"generate\", \"edit\", and \"auto\".""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, + *, + model: Optional[ + Union[ + Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], + Literal["gpt-image-1.5"], + Literal["gpt-image-2"], + Literal["gpt-image-2-2026-04-21"], + Literal["gpt-image-2.5-sunburst"], + Literal["gpt-image-2.5-sunburst-2026-09-08"], + Literal["gpt-image-2.5-flare"], + Literal["gpt-image-2.5-flare-2026-09-08"], + str, + ] + ] = None, + quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None, + size: Optional[ + Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] + ] = None, + output_format: Optional[Literal["png", "webp", "jpeg"]] = None, + output_compression: Optional[int] = None, + moderation: Optional[Literal["auto", "low"]] = None, + background: Optional[Literal["transparent", "opaque", "auto"]] = None, + input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = None, + input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = None, + partial_images: Optional[int] = None, + action: Optional[Union[str, "_models.ImageGenAction"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -29670,34 +32387,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.IMAGE_GENERATION # type: ignore + self.type = ToolType.IMAGE_GENERATION # type: ignore -class ToolChoiceMCP( - ToolChoiceParam, discriminator="mcp" +class ToolLocalShellToolParam( + Tool, discriminator="local_shell" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """MCP tool. + """Local shell tool. - :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: The label of the MCP server to use. Required. - :vartype server_label: str - :ivar name: + :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. + :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - type: Literal[ToolChoiceParamType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """For MCP tools, the type is always ``mcp``. Required. MCP.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server to use. Required.""" + type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - server_label: str, name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -29709,91 +32436,167 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.MCP # type: ignore - - -class ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator="web_search_preview"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW - """ - - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW.""" - - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW # type: ignore - - -class ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator="web_search_preview_2025_03_11"): - """Indicates that the model should use a built-in tool to generate a response. `Learn more about - built-in tools `_. - - :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW_2025_03_11 - """ - - type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" - - @overload - def __init__( - self, - ) -> None: ... + self.type = ToolType.LOCAL_SHELL # type: ignore - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11 # type: ignore +class ToolMcpTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-should-match-keyword-only + """MCP tool. + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: -class ToolConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-tool configuration that controls tool visibility and search behavior. + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] - :ivar pin: When true, the tool is always included in agent context and visible in - ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only - discoverable via ``tool_search``. - :vartype pin: bool - :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native - tool description to improve discoverability. Does not alter ``tools/list`` output. - :vartype additional_search_text: str + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar allowed_callers: + :vartype allowed_callers: list[str or ~azure.ai.projects.models.CallableToolAllowedCaller] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] """ - pin: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """When true, the tool is always included in agent context and visible in ``tools/list``. When - false (default), the tool is hidden from ``tools/list`` and only discoverable via - ``tool_search``.""" - additional_search_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional text indexed for tool_search. Supplements the native tool description to improve - discoverability. Does not alter ``tools/list`` output.""" + type: Literal[ToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the MCP tool. Always ``mcp``. Required. MCP.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. This field + is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a + remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a [str] type or a MCPToolFilter type.""" + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" @overload def __init__( self, *, - pin: Optional[bool] = None, - additional_search_text: Optional[str] = None, + server_label: str, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + tunnel_id: Optional[str] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + allowed_callers: Optional[list[Union[str, "_models.CallableToolAllowedCaller"]]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, + project_connection_id: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @overload @@ -29805,28 +32608,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.MCP # type: ignore -class ToolDescription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Description of a tool that can be used by an agent. +class ToolProgrammaticToolCallingParam(Tool, discriminator="programmatic_tool_calling"): + """ToolProgrammaticToolCallingParam. - :ivar name: The name of the tool. - :vartype name: str - :ivar description: A brief description of the tool's purpose. - :vartype description: str + :ivar type: The type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING. + :vartype type: str or ~azure.ai.projects.models.PROGRAMMATIC_TOOL_CALLING """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A brief description of the tool's purpose.""" + type: Literal[ToolType.PROGRAMMATIC_TOOL_CALLING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``programmatic_tool_calling``. Required. + PROGRAMMATIC_TOOL_CALLING.""" @overload def __init__( self, - *, - name: Optional[str] = None, - description: Optional[str] = None, ) -> None: ... @overload @@ -29838,6 +32637,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.PROGRAMMATIC_TOOL_CALLING # type: ignore class ToolProjectConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -29910,7 +32710,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolboxToolType.TOOLBOX_SEARCH # type: ignore -class ToolSearchToolParam( +class ToolToolSearchToolParam( Tool, discriminator="tool_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only """Tool search tool. @@ -30005,6 +32805,157 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DataGenerationJobType.TOOL_USE # type: ignore +class ToolWebSearchPreviewTool( + Tool, discriminator="web_search_preview" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Web search preview. + + :ivar type: The type of the web search tool. One of ``web_search_preview`` or + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW + :ivar user_location: + :vartype user_location: ~azure.ai.projects.models.ApproximateLocation + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known + values are: "low", "medium", and "high". + :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize + :ivar search_content_types: + :vartype search_content_types: list[str or ~azure.ai.projects.models.SearchContentType] + """ + + type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the web search tool. One of ``web_search_preview`` or + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW.""" + user_location: Optional["_models.ApproximateLocation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: \"low\", + \"medium\", and \"high\".""" + search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + user_location: Optional["_models.ApproximateLocation"] = None, + search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, + search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore + + +class ToolWebSearchTool( + Tool, discriminator="web_search" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Web search. + + :ivar type: The type of the web search tool. One of ``web_search`` or + ``web_search_2025_08_26``. Required. WEB_SEARCH. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH + :ivar external_web_access: Allow live internet access for web search. Defaults to true when + omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new + external content. + :vartype external_web_access: bool + :ivar filters: + :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters + :ivar user_location: The approximate location of the user. If omitted or null, defaults to the + United States. To avoid this fallback, pass ``{"type": "approximate"}`` without location + fields. To localize results, provide the relevant location fields. + :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of + the following types: Literal["low"], Literal["medium"], Literal["high"] + :vartype search_context_size: str or str or str + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] + :ivar custom_search_configuration: The project connections attached to this tool. There can be + a maximum of 1 connection resource attached to the tool. + :vartype custom_search_configuration: ~azure.ai.projects.models.WebSearchConfiguration + """ + + type: Literal[ToolType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. + WEB_SEARCH.""" + external_web_access: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Allow live internet access for web search. Defaults to true when omitted. When false, the web + search tool runs in offline/cache-only mode and will not fetch new external content.""" + filters: Optional["_models.WebSearchToolFilters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The approximate location of the user. If omitted or null, defaults to the United States. To + avoid this fallback, pass ``{\"type\": \"approximate\"}`` without location fields. To localize + results, provide the relevant location fields.""" + search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: + Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. This property is deprecated and will be removed in a future version.""" + custom_search_configuration: Optional["_models.WebSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + @overload + def __init__( + self, + *, + external_web_access: Optional[bool] = None, + filters: Optional["_models.WebSearchToolFilters"] = None, + user_location: Optional["_models.WebSearchApproximateLocation"] = None, + search_context_size: Optional[Literal["low", "medium", "high"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, + custom_search_configuration: Optional["_models.WebSearchConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.WEB_SEARCH # type: ignore + + class TracesDataGenerationJobConfiguration( DataGenerationJobConfiguration, discriminator="traces" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -32149,6 +35100,11 @@ class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstri detection, noise reduction, and transcription. These values are session defaults; a client may override supported fields when connecting. :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig + :ivar soundscape: Optional background ambience and event cues, stored with the agent version + and separate from the audio configuration. Currently rendered only for telephony calls, not + browser WebRTC or direct voice WebSocket sessions. Omit this property to disable all auxiliary + audio. Persisted conversation recordings do not include the soundscape mix. + :vartype soundscape: ~azure.ai.projects.models.VoiceAgentSoundscapeConfig :ivar output_modalities: The output modalities the agent produces. Defaults to ``["audio"]``. ``animation`` and ``avatar`` are available when an avatar is configured. :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] @@ -32216,6 +35172,13 @@ class VoiceAgentDefinition(VoiceAgentBaseDefinition): # pylint: disable=docstri """The audio configuration, including input and output formats, voice, turn detection, noise reduction, and transcription. These values are session defaults; a client may override supported fields when connecting.""" + soundscape: Optional["_models.VoiceAgentSoundscapeConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional background ambience and event cues, stored with the agent version and separate from + the audio configuration. Currently rendered only for telephony calls, not browser WebRTC or + direct voice WebSocket sessions. Omit this property to disable all auxiliary audio. Persisted + conversation recordings do not include the soundscape mix.""" output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -32275,6 +35238,7 @@ def __init__( conversation_engine: Optional["_models.VoiceConversationEngine"] = None, greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, audio: Optional["_models.VoiceAgentAudioConfig"] = None, + soundscape: Optional["_models.VoiceAgentSoundscapeConfig"] = None, output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, @@ -32594,11 +35558,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Settings for transcribing input audio, including the transcription model, Custom Speech - deployments, and phrase hints. + deployments, and phrase hints. When ``model`` is ``azure-speech-streaming``, transcription is + supported for cascaded text-model conversations only (not realtime speech-to-speech models), + requires a nonempty ``language`` such as ``en-US`` (comma-separated locales are supported), and + supports ``custom_speech``, ``phrase_list``, and ``profanity_filter``. :ivar language: The language of the input audio. Supplying the input language in `ISO-639-1 `_ (e.g. ``en``) format will improve - accuracy and latency. + accuracy and latency. Optional for other transcription models; required and must be nonempty + when ``model`` is ``azure-speech-streaming`` (such as ``en-US``; comma-separated locales are + supported). :vartype language: str :ivar languages: Possible languages of the input audio, in `ISO-639-1 `_ format. Supported by @@ -32620,28 +35589,34 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword Literal["minimal"], Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] :vartype delay: str or str or str or str or str :ivar model: The transcription model identifier. Configure customer custom speech deployments - in ``custom_speech``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", + in ``custom_speech``. ``azure-speech-streaming`` is for cascaded text-model conversations only + (not realtime speech-to-speech models), requires a nonempty ``language`` such as ``en-US`` + (comma-separated locales are supported), and supports ``custom_speech``, ``phrase_list``, and + ``profanity_filter``. Required. Known values are: "whisper-1", "gpt-realtime-whisper", "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-transcribe-diarize", "gpt-transcribe", - "gpt-live-transcribe", "mai-transcribe", and "azure-speech". + "gpt-live-transcribe", "mai-transcribe", "azure-speech", and "azure-speech-streaming". :vartype model: str or ~azure.ai.projects.models.VoiceAgentInputTranscriptionModel :ivar custom_speech: Optional customer custom speech deployment configuration, keyed by locale. :vartype custom_speech: dict[str, str] :ivar phrase_list: Optional phrase hints that bias recognition toward domain terms. :vartype phrase_list: list[str] :ivar profanity_filter: Controls how profanity is handled in input transcripts. Supported only - with managed Azure Speech (``azure-speech``), including Custom Speech. Set this property before - the session starts. If omitted, the transcription provider's default applies. You cannot change - the mode during a session. Filtering affects transcript events and the text sent to cascaded - models. It does not change input audio, voice activity detection, or assistant speech; - audio-native models still receive the original audio. Mandatory service masking policies apply - even when you select ``unfiltered``. Known values are: "masked", "unfiltered", and "removed". + with managed Azure Speech (``azure-speech`` and ``azure-speech-streaming``), including Custom + Speech. Set this property before the session starts. If omitted, the transcription provider's + default applies. You cannot change the mode during a session. Filtering affects transcript + events and the text sent to cascaded models. It does not change input audio, voice activity + detection, or assistant speech; audio-native models still receive the original audio. Mandatory + service masking policies apply even when you select ``unfiltered``. Known values are: "masked", + "unfiltered", and "removed". :vartype profanity_filter: str or ~azure.ai.projects.models.VoiceAgentProfanityFilterMode """ language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The language of the input audio. Supplying the input language in `ISO-639-1 `_ (e.g. ``en``) format will improve - accuracy and latency.""" + accuracy and latency. Optional for other transcription models; required and must be nonempty + when ``model`` is ``azure-speech-streaming`` (such as ``en-US``; comma-separated locales are + supported).""" languages: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Possible languages of the input audio, in `ISO-639-1 `_ format. Supported by @@ -32667,9 +35642,13 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword visibility=["read", "create", "update", "delete", "query"] ) """The transcription model identifier. Configure customer custom speech deployments in - ``custom_speech``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", + ``custom_speech``. ``azure-speech-streaming`` is for cascaded text-model conversations only + (not realtime speech-to-speech models), requires a nonempty ``language`` such as ``en-US`` + (comma-separated locales are supported), and supports ``custom_speech``, ``phrase_list``, and + ``profanity_filter``. Required. Known values are: \"whisper-1\", \"gpt-realtime-whisper\", \"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\", \"gpt-4o-transcribe-diarize\", - \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", and \"azure-speech\".""" + \"gpt-transcribe\", \"gpt-live-transcribe\", \"mai-transcribe\", \"azure-speech\", and + \"azure-speech-streaming\".""" custom_speech: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional customer custom speech deployment configuration, keyed by locale.""" phrase_list: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -32678,12 +35657,13 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword visibility=["read", "create", "update", "delete", "query"] ) """Controls how profanity is handled in input transcripts. Supported only with managed Azure - Speech (``azure-speech``), including Custom Speech. Set this property before the session - starts. If omitted, the transcription provider's default applies. You cannot change the mode - during a session. Filtering affects transcript events and the text sent to cascaded models. It - does not change input audio, voice activity detection, or assistant speech; audio-native models - still receive the original audio. Mandatory service masking policies apply even when you select - ``unfiltered``. Known values are: \"masked\", \"unfiltered\", and \"removed\".""" + Speech (``azure-speech`` and ``azure-speech-streaming``), including Custom Speech. Set this + property before the session starts. If omitted, the transcription provider's default applies. + You cannot change the mode during a session. Filtering affects transcript events and the text + sent to cascaded models. It does not change input audio, voice activity detection, or assistant + speech; audio-native models still receive the original audio. Mandatory service masking + policies apply even when you select ``unfiltered``. Known values are: \"masked\", + \"unfiltered\", and \"removed\".""" @overload def __init__( @@ -33089,7 +36069,7 @@ class VoiceAgentLiveDelegationItem(_Model): # pylint: disable=docstring-keyword not the task text. :ivar id: The unique ID of the delegation. Use this as delegation_id when replying to - client-owned work or correlating Responses events. Required. + client-owned work or correlating backend events. Required. :vartype id: str :ivar type: The object type, always ``delegation``. Required. Default value is "delegation". :vartype type: str @@ -33104,7 +36084,7 @@ class VoiceAgentLiveDelegationItem(_Model): # pylint: disable=docstring-keyword id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the delegation. Use this as delegation_id when replying to client-owned work - or correlating Responses events. Required.""" + or correlating backend events. Required.""" type: Literal["delegation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The object type, always ``delegation``. Required. Default value is \"delegation\".""" response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -33483,12 +36463,16 @@ class VoiceAgentLiveSessionResource(_Model): # pylint: disable=docstring-keywor :ivar instructions: :vartype instructions: str :ivar input: Ordered text-only history supplied before startup. Supports developer, user, and - assistant messages with one text part each; at most 128 messages and 8,192 rendered tokens in - total. + assistant messages with one text part each; at most 128 messages and a configured + rendered-token limit (8,192 by default). :vartype input: list[~azure.ai.projects.models.LiveInitialItem] :ivar audio: Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP negotiate their media format. Voice and format are immutable after startup. :vartype audio: ~azure.ai.projects.models.LiveInitialSessionAudioParam + :ivar triggers: At most one Decisions trigger per transcript event type. Triggers run + independently of delegation. On update, omit triggers to keep the current configuration, send a + list to replace it, or send an empty list to disable triggers. + :vartype triggers: list[~azure.ai.projects.models.LiveDecisionTriggerInputParam_2] :ivar store: Whether to store the session for later forking and recording download. Defaults to false for new sessions. :vartype store: bool @@ -33519,12 +36503,19 @@ class VoiceAgentLiveSessionResource(_Model): # pylint: disable=docstring-keywor visibility=["read", "create", "update", "delete", "query"] ) """Ordered text-only history supplied before startup. Supports developer, user, and assistant - messages with one text part each; at most 128 messages and 8,192 rendered tokens in total.""" + messages with one text part each; at most 128 messages and a configured rendered-token limit + (8,192 by default).""" audio: Optional["_models.LiveInitialSessionAudioParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC and SIP negotiate their media format. Voice and format are immutable after startup.""" + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """At most one Decisions trigger per transcript event type. Triggers run independently of + delegation. On update, omit triggers to keep the current configuration, send a list to replace + it, or send an empty list to disable triggers.""" store: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Whether to store the session for later forking and recording download. Defaults to false for new sessions.""" @@ -33559,6 +36550,7 @@ def __init__( instructions: Optional[str] = None, input: Optional[list["_models.LiveInitialItem"]] = None, audio: Optional["_models.LiveInitialSessionAudioParam"] = None, + triggers: Optional[list["_models.LiveDecisionTriggerInputParam_2"]] = None, store: Optional[bool] = None, client: Optional["_models.LiveClientConfigParam"] = None, delegation: Optional["_unions.VoiceAgentLiveDelegation"] = None, @@ -33787,18 +36779,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VoiceAgentNoiseReduction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Input audio noise reduction configuration. - - :ivar type: The noise reduction mode. Required. Known values are: "near_field", "far_field", - and "azure_deep_noise_suppression". + """Input audio noise reduction configuration. ``azure_deep_noise_suppression_headset`` and + ``azure_personal_noise_suppression`` are modes for local voice activity detection that enhance + detection audio without changing the audio used for recognition. + + :ivar type: The noise reduction mode. ``azure_deep_noise_suppression_headset`` provides + headset-optimized noise suppression for local voice activity detection, optimized for + low-sample-rate audio including 8 kHz telephony audio without changing recognition audio (not + restricted to headset devices). ``azure_personal_noise_suppression`` starts with headset + suppression for local voice activity detection and personalizes detection after automatic + speaker enrollment while keeping recognition audio unchanged and keeping headset suppression + active when personalization is unavailable. Required. Known values are: "near_field", + "far_field", "azure_deep_noise_suppression", "azure_deep_noise_suppression_headset", and + "azure_personal_noise_suppression". :vartype type: str or ~azure.ai.projects.models.VoiceAgentNoiseReductionType """ type: Union[str, "_models.VoiceAgentNoiseReductionType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The noise reduction mode. Required. Known values are: \"near_field\", \"far_field\", and - \"azure_deep_noise_suppression\".""" + """The noise reduction mode. ``azure_deep_noise_suppression_headset`` provides headset-optimized + noise suppression for local voice activity detection, optimized for low-sample-rate audio + including 8 kHz telephony audio without changing recognition audio (not restricted to headset + devices). ``azure_personal_noise_suppression`` starts with headset suppression for local voice + activity detection and personalizes detection after automatic speaker enrollment while keeping + recognition audio unchanged and keeping headset suppression active when personalization is + unavailable. Required. Known values are: \"near_field\", \"far_field\", + \"azure_deep_noise_suppression\", \"azure_deep_noise_suppression_headset\", and + \"azure_personal_noise_suppression\".""" @overload def __init__( @@ -35300,23 +38308,155 @@ class VoiceAgentSessionResponseConfig(_Model): # pylint: disable=docstring-keyw visibility=["read", "create", "update", "delete", "query"] ) """A proactive assistant greeting started after session configuration.""" - object: Literal["realtime.session"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session identifier. Required.""" - model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The selected model. Required.""" - expires_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The session expiration time as a Unix timestamp in seconds.""" + object: Literal["realtime.session"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type. Always ``realtime.session``. Required. Default value is \"realtime.session\".""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session identifier. Required.""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The selected model. Required.""" + expires_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The session expiration time as a Unix timestamp in seconds.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + model: str, + instructions: Optional[str] = None, + temperature: Optional[float] = None, + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, + audio: Optional["_models.VoiceAgentAudioConfig"] = None, + avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, + animation: Optional["_models.VoiceAgentAnimationConfig"] = None, + tools: Optional[list["_models.VoiceAgentTool"]] = None, + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + parallel_tool_calls: Optional[bool] = None, + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, + metadata: Optional[dict[str, str]] = None, + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, + greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + expires_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" + + +class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The stable realtime session settings accepted in a ``session.update`` client event. + + :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". + :vartype type: str + :ivar instructions: Instructions applied throughout the session. + :vartype instructions: str + :ivar temperature: The sampling temperature for compatible cascaded pipelines. + :vartype temperature: float + :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type + or a Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar output_modalities: The output modalities enabled for the session. + :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] + :ivar audio: The input- and output-audio settings for the session. + :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig + :ivar avatar: The avatar settings for the session. + :vartype avatar: ~azure.ai.projects.models.VoiceAgentSessionAvatarConfig + :ivar animation: Animation settings for the session. + :vartype animation: ~azure.ai.projects.models.VoiceAgentAnimationConfig + :ivar tools: Tools available to the session. + :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] + :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: + Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or + ~azure.ai.projects.models.ToolChoiceMCP + :ivar reasoning: Reasoning settings for compatible realtime models. + :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning + :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. + :vartype parallel_tool_calls: bool + :ivar include: Additional fields to include in service outputs. + :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] + :ivar metadata: Up to 16 string key-value pairs attached to the session. + :vartype metadata: dict[str, str] + :ivar interim_response: Interim-response settings for latency and tool execution. + :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig + :ivar greeting: A proactive assistant greeting started after session configuration. + :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig + """ + + type: Literal["realtime"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions applied throughout the session.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sampling temperature for compatible cascaded pipelines.""" + max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] + type.""" + output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output modalities enabled for the session.""" + audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The input- and output-audio settings for the session.""" + avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The avatar settings for the session.""" + animation: Optional["_models.VoiceAgentAnimationConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Animation settings for the session.""" + tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tools available to the session.""" + tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], + Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Reasoning settings for compatible realtime models.""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the model may call multiple tools in parallel.""" + include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional fields to include in service outputs.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Up to 16 string key-value pairs attached to the session.""" + interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Interim-response settings for latency and tool execution.""" + greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A proactive assistant greeting started after session configuration.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - model: str, instructions: Optional[str] = None, temperature: Optional[float] = None, max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, @@ -35332,7 +38472,6 @@ def __init__( metadata: Optional[dict[str, str]] = None, interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, - expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -35345,125 +38484,183 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.type: Literal["realtime"] = "realtime" - self.object: Literal["realtime.session"] = "realtime.session" -class VoiceAgentSessionUpdateConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The stable realtime session settings accepted in a ``session.update`` client event. +class VoiceAgentSoundscapeConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Agent-owned background ambience and event cues. Each omitted track is disabled. The service + rejects unknown fields; custom uploads, URLs, and inline audio are not supported. - :ivar type: The session type. Always ``realtime``. Required. Default value is "realtime". - :vartype type: str - :ivar instructions: Instructions applied throughout the session. - :vartype instructions: str - :ivar temperature: The sampling temperature for compatible cascaded pipelines. - :vartype temperature: float - :ivar max_output_tokens: The maximum output-token count for one response. Is either a int type - or a Literal["inf"] type. - :vartype max_output_tokens: int or str - :ivar output_modalities: The output modalities enabled for the session. - :vartype output_modalities: list[str or ~azure.ai.projects.models.VoiceOutputModality] - :ivar audio: The input- and output-audio settings for the session. - :vartype audio: ~azure.ai.projects.models.VoiceAgentAudioConfig - :ivar avatar: The avatar settings for the session. - :vartype avatar: ~azure.ai.projects.models.VoiceAgentSessionAvatarConfig - :ivar animation: Animation settings for the session. - :vartype animation: ~azure.ai.projects.models.VoiceAgentAnimationConfig - :ivar tools: Tools available to the session. - :vartype tools: list[~azure.ai.projects.models.VoiceAgentTool] - :ivar tool_choice: Tool-selection behavior for the session. Is one of the following types: - Literal["none"], Literal["auto"], Literal["required"], ToolChoiceFunction, ToolChoiceMCP - :vartype tool_choice: str or str or str or ~azure.ai.projects.models.ToolChoiceFunction or - ~azure.ai.projects.models.ToolChoiceMCP - :ivar reasoning: Reasoning settings for compatible realtime models. - :vartype reasoning: ~azure.ai.projects.models.RealtimeReasoning - :ivar parallel_tool_calls: Whether the model may call multiple tools in parallel. - :vartype parallel_tool_calls: bool - :ivar include: Additional fields to include in service outputs. - :vartype include: list[str or ~azure.ai.projects.models.VoiceAgentSessionIncludeOption] - :ivar metadata: Up to 16 string key-value pairs attached to the session. - :vartype metadata: dict[str, str] - :ivar interim_response: Interim-response settings for latency and tool execution. - :vartype interim_response: ~azure.ai.projects.models.VoiceAgentInterimResponseConfig - :ivar greeting: A proactive assistant greeting started after session configuration. - :vartype greeting: ~azure.ai.projects.models.VoiceAgentGreetingConfig + :ivar background: Continuous background ambience that continues during caller and agent speech. + :vartype background: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar working: A loop played while a non-call-control tool is pending and the agent is silent, + after the configured delay. + :vartype working: ~azure.ai.projects.models.VoiceAgentSoundscapeWorkingTrackConfig + :ivar opening: An interruptible cue played before the first agent speech. + :vartype opening: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar transfer: A one-shot cue played after queued agent speech drains and before a committed + call transfer. + :vartype transfer: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig + :ivar closing: A one-shot cue played after queued agent speech drains and before a committed + session end. + :vartype closing: ~azure.ai.projects.models.VoiceAgentSoundscapeTrackConfig """ - type: Literal["realtime"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The session type. Always ``realtime``. Required. Default value is \"realtime\".""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Instructions applied throughout the session.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sampling temperature for compatible cascaded pipelines.""" - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = rest_field( + background: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The maximum output-token count for one response. Is either a int type or a Literal[\"inf\"] - type.""" - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = rest_field( + """Continuous background ambience that continues during caller and agent speech.""" + working: Optional["_models.VoiceAgentSoundscapeWorkingTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The output modalities enabled for the session.""" - audio: Optional["_models.VoiceAgentAudioConfig"] = rest_field( + """A loop played while a non-call-control tool is pending and the agent is silent, after the + configured delay.""" + opening: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The input- and output-audio settings for the session.""" - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = rest_field( + """An interruptible cue played before the first agent speech.""" + transfer: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The avatar settings for the session.""" - animation: Optional["_models.VoiceAgentAnimationConfig"] = rest_field( + """A one-shot cue played after queued agent speech drains and before a committed call transfer.""" + closing: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Animation settings for the session.""" - tools: Optional[list["_models.VoiceAgentTool"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tools available to the session.""" - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Tool-selection behavior for the session. Is one of the following types: Literal[\"none\"], - Literal[\"auto\"], Literal[\"required\"], ToolChoiceFunction, ToolChoiceMCP""" - reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + """A one-shot cue played after queued agent speech drains and before a committed session end.""" + + @overload + def __init__( + self, + *, + background: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + working: Optional["_models.VoiceAgentSoundscapeWorkingTrackConfig"] = None, + opening: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + transfer: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + closing: Optional["_models.VoiceAgentSoundscapeTrackConfig"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentSoundscapeSourceConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A packaged sound selected from the service-managed catalogue. The service rejects unknown + source fields and discriminator values. + + :ivar type: The audio source type. Always ``built_in``. Required. Default value is "built_in". + :vartype type: str + :ivar name: The name of the packaged sound. Only the listed built-in sounds are accepted. + Required. Known values are: "office", "call_center", "busy_street", "people_talking", + "street_and_metro_station", "ding1", and "ding2". + :vartype name: str or ~azure.ai.projects.models.VoiceAgentSoundscapeSound + """ + + type: Literal["built_in"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The audio source type. Always ``built_in``. Required. Default value is \"built_in\".""" + name: Union[str, "_models.VoiceAgentSoundscapeSound"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Reasoning settings for compatible realtime models.""" - parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the model may call multiple tools in parallel.""" - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = rest_field( + """The name of the packaged sound. Only the listed built-in sounds are accepted. Required. Known + values are: \"office\", \"call_center\", \"busy_street\", \"people_talking\", + \"street_and_metro_station\", \"ding1\", and \"ding2\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.VoiceAgentSoundscapeSound"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["built_in"] = "built_in" + + +class VoiceAgentSoundscapeTrackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A soundscape track with its own audio source and playback volume. + + :ivar source: The required audio source for this track. Required. + :vartype source: ~azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig + :ivar gain: Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, + the service defaults to 1. A value of 0 mutes this track. + :vartype gain: float + """ + + source: "_models.VoiceAgentSoundscapeSourceConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Additional fields to include in service outputs.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Up to 16 string key-value pairs attached to the session.""" - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = rest_field( + """The required audio source for this track. Required.""" + gain: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, the service + defaults to 1. A value of 0 mutes this track.""" + + @overload + def __init__( + self, + *, + source: "_models.VoiceAgentSoundscapeSourceConfig", + gain: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VoiceAgentSoundscapeWorkingTrackConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A working-loop track with a delay measured from the first pending non-call-control tool. + + :ivar source: The required audio source for this track. Required. + :vartype source: ~azure.ai.projects.models.VoiceAgentSoundscapeSourceConfig + :ivar gain: Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, + the service defaults to 1. A value of 0 mutes this track. + :vartype gain: float + :ivar delay_ms: The delay in milliseconds before working audio starts, from 0 to 10000. If + omitted, the service defaults to 1000 milliseconds. This delays only working audio, not tool + execution, and is valid only on the working track. + :vartype delay_ms: ~datetime.timedelta + """ + + source: "_models.VoiceAgentSoundscapeSourceConfig" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Interim-response settings for latency and tool execution.""" - greeting: Optional["_models.VoiceAgentGreetingConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The required audio source for this track. Required.""" + gain: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Linear playback gain from 0 to 1, independent of agent speech volume. If omitted, the service + defaults to 1. A value of 0 mutes this track.""" + delay_ms: Optional[datetime.timedelta] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="duration-milliseconds-int" ) - """A proactive assistant greeting started after session configuration.""" + """The delay in milliseconds before working audio starts, from 0 to 10000. If omitted, the service + defaults to 1000 milliseconds. This delays only working audio, not tool execution, and is valid + only on the working track.""" @overload def __init__( self, *, - instructions: Optional[str] = None, - temperature: Optional[float] = None, - max_output_tokens: Optional["_unions.VoiceAgentMaxOutputTokens"] = None, - output_modalities: Optional[list[Union[str, "_models.VoiceOutputModality"]]] = None, - audio: Optional["_models.VoiceAgentAudioConfig"] = None, - avatar: Optional["_models.VoiceAgentSessionAvatarConfig"] = None, - animation: Optional["_models.VoiceAgentAnimationConfig"] = None, - tools: Optional[list["_models.VoiceAgentTool"]] = None, - tool_choice: Optional["_unions.VoiceAgentToolChoice"] = None, - reasoning: Optional["_models.RealtimeReasoning"] = None, - parallel_tool_calls: Optional[bool] = None, - include: Optional[list[Union[str, "_models.VoiceAgentSessionIncludeOption"]]] = None, - metadata: Optional[dict[str, str]] = None, - interim_response: Optional["_models.VoiceAgentInterimResponseConfig"] = None, - greeting: Optional["_models.VoiceAgentGreetingConfig"] = None, + source: "_models.VoiceAgentSoundscapeSourceConfig", + gain: Optional[float] = None, + delay_ms: Optional[datetime.timedelta] = None, ) -> None: ... @overload @@ -35475,7 +38672,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["realtime"] = "realtime" class VoiceAgentStaticInterimResponseConfig( @@ -36179,8 +39375,12 @@ class VoiceHostedAgentConversationEngine( VoiceConversationEngine, discriminator="hosted_agent" ): # pylint: disable=docstring-keyword-should-match-keyword-only """A closed reference to the hosted text agent that owns conversation handling for a voice agent. - The hosted agent is resolved within the same project and must support the ``invocations_ws`` - protocol, Voice Live compatibility, and Bridge Protocol 1.0. + The hosted agent is resolved within the same project and must declare + ``voice_conversation_engine`` version ``1.0.0``. Voice Live connects through the dedicated + voice-conversation-engine endpoint using the existing Bridge Protocol 1.0 wire semantics; the + Bridge message version is independent of the container protocol version and the Hosted Agents + API version ``v1``. Declaring ``invocations_ws`` is optional and does not substitute for + ``voice_conversation_engine``. :ivar type: Selects a hosted Foundry agent as the conversation engine. Required. Default value is "hosted_agent". @@ -36744,150 +39944,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebSearchPreviewTool( - Tool, discriminator="web_search_preview" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Web search preview. - - :ivar type: The type of the web search tool. One of ``web_search_preview`` or - ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW - :ivar user_location: - :vartype user_location: ~azure.ai.projects.models.ApproximateLocation - :ivar search_context_size: High level guidance for the amount of context window space to use - for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known - values are: "low", "medium", and "high". - :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize - :ivar search_content_types: - :vartype search_content_types: list[str or ~azure.ai.projects.models.SearchContentType] - """ - - type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool. One of ``web_search_preview`` or - ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW.""" - user_location: Optional["_models.ApproximateLocation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """High level guidance for the amount of context window space to use for the search. One of - ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: \"low\", - \"medium\", and \"high\".""" - search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - user_location: Optional["_models.ApproximateLocation"] = None, - search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, - search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore - - -class WebSearchTool(Tool, discriminator="web_search"): # pylint: disable=docstring-keyword-should-match-keyword-only - """Web search. - - :ivar type: The type of the web search tool. One of ``web_search`` or - ``web_search_2025_08_26``. Required. WEB_SEARCH. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH - :ivar external_web_access: Allow live internet access for web search. Defaults to true when - omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new - external content. - :vartype external_web_access: bool - :ivar filters: - :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters - :ivar user_location: - :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation - :ivar search_context_size: High level guidance for the amount of context window space to use - for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of - the following types: Literal["low"], Literal["medium"], Literal["high"] - :vartype search_context_size: str or str or str - :ivar name: Deprecated. This property is deprecated and will be removed in a future version. - :vartype name: str - :ivar description: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype description: str - :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future - version. - :vartype tool_configs: dict[str, ~azure.ai.projects.models.ToolConfig] - :ivar custom_search_configuration: The project connections attached to this tool. There can be - a maximum of 1 connection resource attached to the tool. - :vartype custom_search_configuration: ~azure.ai.projects.models.WebSearchConfiguration - """ - - type: Literal[ToolType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. - WEB_SEARCH.""" - external_web_access: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Allow live internet access for web search. Defaults to true when omitted. When false, the web - search tool runs in offline/cache-only mode and will not fetch new external content.""" - filters: Optional["_models.WebSearchToolFilters"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """High level guidance for the amount of context window space to use for the search. One of - ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: - Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deprecated. This property is deprecated and will be removed in a future version.""" - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Deprecated. This property is deprecated and will be removed in a future version.""" - custom_search_configuration: Optional["_models.WebSearchConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The project connections attached to this tool. There can be a maximum of 1 connection resource - attached to the tool.""" - - @overload - def __init__( - self, - *, - external_web_access: Optional[bool] = None, - filters: Optional["_models.WebSearchToolFilters"] = None, - user_location: Optional["_models.WebSearchApproximateLocation"] = None, - search_context_size: Optional[Literal["low", "medium", "high"]] = None, - name: Optional[str] = None, - description: Optional[str] = None, - tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, - custom_search_configuration: Optional["_models.WebSearchConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ToolType.WEB_SEARCH # type: ignore - - class WebSearchToolboxTool( ToolboxTool, discriminator="web_search" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -36909,7 +39965,9 @@ class WebSearchToolboxTool( :vartype external_web_access: bool :ivar filters: :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters - :ivar user_location: + :ivar user_location: The approximate location of the user. If omitted or null, defaults to the + United States. To avoid this fallback, pass ``{"type": "approximate"}`` without location + fields. To localize results, provide the relevant location fields. :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation :ivar search_context_size: High level guidance for the amount of context window space to use for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of @@ -36931,6 +39989,9 @@ class WebSearchToolboxTool( user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """The approximate location of the user. If omitted or null, defaults to the United States. To + avoid this fallback, pass ``{\"type\": \"approximate\"}`` without location fields. To localize + results, provide the relevant location fields.""" search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index e2153981af91..38213d2c8974 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: e30cf6f0dcfbca167edf731d4e48874a63639e8b +commit: e5234c254d970b5e15e287b5830a6bd91780e0a6 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From 7df521dfa5738313ec4c1bc4e6587a56d35e453f Mon Sep 17 00:00:00 2001 From: howieleung Date: Thu, 29 Oct 2026 13:50:14 -0700 Subject: [PATCH 16/20] Update CHANGELOG for release 2.10.0: add new features and bug fixes --- sdk/ai/azure-ai-projects/CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 5b06b0d63697..85c09772ad40 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,6 +1,20 @@ # Release History -## 2.10.0 (Unreleased) +## 2.10.0 (2026-10-30) + +### Features Added + +* Added optional `VoiceAgentDefinition.soundscape` for built-in background ambience and event cues in telephony calls, with `VoiceAgentSoundscapeConfig`, `VoiceAgentSoundscapeSourceConfig`, `VoiceAgentSoundscapeTrackConfig`, `VoiceAgentSoundscapeWorkingTrackConfig`, and `VoiceAgentSoundscapeSound`. +* Added optional `VoiceAgentInputTranscription.profanity_filter` and `VoiceAgentProfanityFilterMode` for configuring Azure Speech input-transcript filtering before a session starts. +* Added `VoiceAgentInputTranscriptionModel.AZURE_SPEECH_STREAMING` for Azure Speech streaming transcription in cascaded text-model conversations. This model requires a nonempty `VoiceAgentInputTranscription.language` and is not supported with realtime speech-to-speech models. +* Added `VoiceAgentNoiseReductionType.AZURE_DEEP_NOISE_SUPPRESSION_HEADSET` and `VoiceAgentNoiseReductionType.AZURE_PERSONAL_NOISE_SUPPRESSION` for local voice activity detection without changing recognition audio. +* Added `AgentEndpointProtocol.VOICE_CONVERSATION_ENGINE` for hosted text agents used as Voice Agent conversation engines. Hosted agents must declare this protocol with version `1.0.0`; `invocations_ws` does not substitute for it. +* Added optional `HostedAgentDefinition.enable_memory_snapshot` to start hosted-agent sessions from a snapshot of the initialized process instead of starting the process from its image. +* Added known `ImageGenTool.model` values `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, with `xhigh` and `max` quality options for these models. + +### Bugs Fixed + +* Fixed tracing to record `temperature=0` and `top_p=0` instead of omitting these valid values. ## 2.9.0 (2026-10-16) From 6fb2ef16e4d2b2006bed0a4e52c6d83036b9707e Mon Sep 17 00:00:00 2001 From: howieleung Date: Thu, 29 Oct 2026 13:52:21 -0700 Subject: [PATCH 17/20] Restore tsp-location.yaml file with directory and additional directories for AI projects --- .../{tsp-location.yaml => tsp-location.yaml.saved} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sdk/ai/azure-ai-projects/{tsp-location.yaml => tsp-location.yaml.saved} (100%) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml.saved similarity index 100% rename from sdk/ai/azure-ai-projects/tsp-location.yaml rename to sdk/ai/azure-ai-projects/tsp-location.yaml.saved From 64c21d95abbd449221b6daa3cb8ba6db2ed9dbdf Mon Sep 17 00:00:00 2001 From: howieleung Date: Thu, 29 Oct 2026 15:36:43 -0700 Subject: [PATCH 18/20] remove emitter changes --- eng/emitter-package-lock.json | 8 +- eng/emitter-package.json | 2 +- sdk/ai/azure-ai-projects/api.md | 8 +- sdk/ai/azure-ai-projects/api.metadata.yml | 2 +- .../azure/ai/projects/models/_enums.py | 2 +- .../azure/ai/projects/models/_models.py | 163 +++++++----------- 6 files changed, 73 insertions(+), 112 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 2ebd5e0eb399..6dea4b09bc34 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.63.10" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.29.0", + "@azure-tools/openai-typespec": "1.28.0", "@azure-tools/typespec-autorest": "~0.73.0", "@azure-tools/typespec-azure-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", @@ -31,9 +31,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.29.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.29.0.tgz", - "integrity": "sha512-G4h4rgqB9NB3dcy8ayIHdLQ61D7r6G0WL/EQAKJ56lwPqtxjMXCWTskwjXleP3Dy7kDlpmh48SIaVLzmgidDPA==", + "version": "1.28.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.28.0.tgz", + "integrity": "sha1-rXCoTFopEeA3qKL8/P3Uim0ZuuA=", "dev": true, "license": "MIT", "peerDependencies": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index a1d14c4a3efd..79c0abbe49bf 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -22,6 +22,6 @@ "@azure-tools/typespec-client-generator-core": "~0.73.0", "@azure-tools/typespec-azure-portal-core": "~0.73.0", "@azure-tools/typespec-liftr-base": "0.13.0", - "@azure-tools/openai-typespec": "1.29.0" + "@azure-tools/openai-typespec": "1.28.0" } } diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index d134c71dec37..26fdbb6b3726 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -8423,13 +8423,13 @@ namespace azure.ai.projects.models description: Optional[str] input_fidelity: Optional[Union[str, InputFidelity]] input_image_mask: Optional[ImageGenToolInputImageMask] - model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-5-sunburst"], Literal["gpt-image-5-sunburst-2026-09-08"], Literal["gpt-image-5-flare"], Literal["gpt-image-5-flare-2026-09-08"], str]] + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], str]] moderation: Optional[Literal["auto", "low"]] name: Optional[str] output_compression: Optional[int] output_format: Optional[Literal["png", "webp", "jpeg"]] partial_images: Optional[int] - quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] + quality: Optional[Literal["low", "medium", "high", "auto"]] size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] tool_configs: Optional[dict[str, ToolConfig]] type: Literal[ToolType.IMAGE_GENERATION] @@ -8443,13 +8443,13 @@ namespace azure.ai.projects.models description: Optional[str] = ..., input_fidelity: Optional[Union[str, InputFidelity]] = ..., input_image_mask: Optional[ImageGenToolInputImageMask] = ..., - model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], Literal[gpt-image-5-sunburst], Literal[gpt-image-5-sunburst-2026-09-08], Literal[gpt-image-5-flare], Literal[gpt-image-5-flare-2026-09-08], str]] = ..., + model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], Literal[gpt-image-2], Literal[gpt-image-2-2026-04-21], str]] = ..., moderation: Optional[Literal[auto, low]] = ..., name: Optional[str] = ..., output_compression: Optional[int] = ..., output_format: Optional[Literal[png, webp, jpeg]] = ..., partial_images: Optional[int] = ..., - quality: Optional[Literal[low, medium, high, xhigh, max, auto]] = ..., + quality: Optional[Literal[low, medium, high, auto]] = ..., size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., tool_configs: Optional[dict[str, ToolConfig]] = ... ) -> None: ... diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index ad5516a35b18..ab6473e705e2 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiHash: 0fa3ee4d720a5097b326a1a880488cb348281242682dccd36ab423263ba6a86b +apiHash: 21fe5e8ab12ba25890b36ce00ad6787d27f950347b9f58baa3518794a6a02de1 packageVersion: 2.10.0 parserVersion: 0.3.31 pythonVersion: 3.12.4 diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 0c681d00bac1..6590dd28ec1b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -1439,7 +1439,7 @@ class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): ``minimal``, ``low``, ``medium``, ``high``, ``xhigh``, and ``max``. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the `reasoning guide - `_ for model-specific support. + `_ for model-specific support. """ NONE = "none" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 276f415b7c47..c1cede3ade4d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -11700,9 +11700,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionParameters(_Model): """The parameters the functions accepts, described as a JSON Schema object. See the `guide - `_ for examples, and the `JSON - Schema reference `_ for documentation about - the format. Omitting ``parameters`` defines a function with an empty parameter list. + `_ for examples, and the `JSON Schema reference + `_ for documentation about the format. + Omitting ``parameters`` defines a function with an empty parameter list. """ @@ -12570,28 +12570,23 @@ class ImageGenTool( :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION :ivar model: Is one of the following types: Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], Literal["gpt-image-2"], - Literal["gpt-image-2-2026-04-21"], Literal["gpt-image-2.5-sunburst"], - Literal["gpt-image-2.5-sunburst-2026-09-08"], Literal["gpt-image-2.5-flare"], - Literal["gpt-image-2.5-flare-2026-09-08"], str - :vartype model: str or str or str or str or str or str or str or str or str or str - :ivar quality: The quality of the generated image. The GPT image models support ``low``, - ``medium``, and ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including - their ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one - of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"], - Literal["max"], Literal["auto"] - :vartype quality: str or str or str or str or str or str - :ivar size: The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, - ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and - ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` - strings, for example ``1536x864``. Width and height must both be divisible by 16 and the - requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are - experimental, and the maximum supported resolution is ``3840x2160``. The requested size must - also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, - ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported - for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, - or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. - Is one of the following types: Literal["1024x1024"], Literal["1024x1536"], - Literal["1536x1024"], Literal["auto"], str + Literal["gpt-image-2-2026-04-21"], str + :vartype model: str or str or str or str or str or str + :ivar quality: The quality of the generated image. One of ``low``, ``medium``, ``high``, or + ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype quality: str or str or str or str + :ivar size: The size of the generated images. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` strings, + for example ``1536x864``. Width and height must both be divisible by 16 and the requested + aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are experimental, and + the maximum supported resolution is ``3840x2160``. The requested size must also satisfy the + model's current pixel and edge limits. The standard sizes ``1024x1024``, ``1536x1024``, and + ``1024x1536`` are supported by the GPT image models; ``auto`` is supported for models that + allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, or + ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is + one of the following types: Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], + Literal["auto"], str :vartype size: str or str or str or str or str :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], @@ -12603,12 +12598,10 @@ class ImageGenTool( Literal["auto"] type or a Literal["low"] type. :vartype moderation: str or str :ivar background: Set the background of the generated image. One of ``transparent``, - ``opaque``, or ``auto``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including - their ``2026-09-08`` snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent - backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and - ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the - output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: - Literal["transparent"], Literal["opaque"], Literal["auto"] + ``opaque``, or ``auto``. Transparent backgrounds are available for supported GPT Image models. + For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, this support is in preview. When using + ``transparent``, set the output format to ``png`` or ``webp``. Default: ``auto``. Is one of the + following types: Literal["transparent"], Literal["opaque"], Literal["auto"] :vartype background: str or str or str :ivar input_fidelity: Known values are: "high" and "low". :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity @@ -12640,40 +12633,30 @@ class ImageGenTool( Literal["gpt-image-1.5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], - Literal["gpt-image-2.5-sunburst"], - Literal["gpt-image-2.5-sunburst-2026-09-08"], - Literal["gpt-image-2.5-flare"], - Literal["gpt-image-2.5-flare-2026-09-08"], str, ] ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], - Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], - Literal[\"gpt-image-2.5-sunburst\"], Literal[\"gpt-image-2.5-sunburst-2026-09-08\"], - Literal[\"gpt-image-2.5-flare\"], Literal[\"gpt-image-2.5-flare-2026-09-08\"], str""" - quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = rest_field( + Literal[\"gpt-image-1.5\"], Literal[\"gpt-image-2\"], Literal[\"gpt-image-2-2026-04-21\"], str""" + quality: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The quality of the generated image. The GPT image models support ``low``, ``medium``, and - ``high``. ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their - ``2026-09-08`` snapshots, also support ``xhigh`` and ``max``. Default: ``auto``. Is one of the - following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"], - Literal[\"max\"], Literal[\"auto\"]""" + """The quality of the generated image. One of ``low``, ``medium``, ``high``, or ``auto``. Default: + ``auto``. Is one of the following types: Literal[\"low\"], Literal[\"medium\"], + Literal[\"high\"], Literal[\"auto\"]""" size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """The size of the generated images. For ``gpt-image-2``, ``gpt-image-2-2026-04-21``, - ``gpt-image-2.5-sunburst``, ``gpt-image-2.5-sunburst-2026-09-08``, ``gpt-image-2.5-flare``, and - ``gpt-image-2.5-flare-2026-09-08``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` - strings, for example ``1536x864``. Width and height must both be divisible by 16 and the - requested aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are - experimental, and the maximum supported resolution is ``3840x2160``. The requested size must - also satisfy the model's current pixel and edge limits. The standard sizes ``1024x1024``, - ``1536x1024``, and ``1024x1536`` are supported by the GPT image models; ``auto`` is supported - for models that allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, - or ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. - Is one of the following types: Literal[\"1024x1024\"], Literal[\"1024x1536\"], - Literal[\"1536x1024\"], Literal[\"auto\"], str""" + """The size of the generated images. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, arbitrary + resolutions are supported as ``WIDTHxHEIGHT`` strings, for example ``1536x864``. Width and + height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above ``2560x1440`` are experimental, and the maximum supported resolution is + ``3840x2160``. The requested size must also satisfy the model's current pixel and edge limits. + The standard sizes ``1024x1024``, ``1536x1024``, and ``1024x1536`` are supported by the GPT + image models; ``auto`` is supported for models that allow automatic sizing. For ``dall-e-2``, + use one of ``256x256``, ``512x512``, or ``1024x1024``. For ``dall-e-3``, use one of + ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is one of the following types: + Literal[\"1024x1024\"], Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12690,12 +12673,10 @@ class ImageGenTool( visibility=["read", "create", "update", "delete", "query"] ) """Set the background of the generated image. One of ``transparent``, ``opaque``, or ``auto``. - ``gpt-image-2.5-sunburst`` and ``gpt-image-2.5-flare``, including their ``2026-09-08`` - snapshots, support ``opaque`` and ``transparent`` backgrounds. Transparent backgrounds are - available for supported GPT Image models. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, - this support is in preview. When using ``transparent``, set the output format to ``png`` or - ``webp``. Default: ``auto``. Is one of the following types: Literal[\"transparent\"], - Literal[\"opaque\"], Literal[\"auto\"]""" + Transparent backgrounds are available for supported GPT Image models. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, this support is in preview. When using ``transparent``, set the + output format to ``png`` or ``webp``. Default: ``auto``. Is one of the following types: + Literal[\"transparent\"], Literal[\"opaque\"], Literal[\"auto\"]""" input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12732,14 +12713,10 @@ def __init__( Literal["gpt-image-1.5"], Literal["gpt-image-2"], Literal["gpt-image-2-2026-04-21"], - Literal["gpt-image-2.5-sunburst"], - Literal["gpt-image-2.5-sunburst-2026-09-08"], - Literal["gpt-image-2.5-flare"], - Literal["gpt-image-2.5-flare-2026-09-08"], str, ] ] = None, - quality: Optional[Literal["low", "medium", "high", "xhigh", "max", "auto"]] = None, + quality: Optional[Literal["low", "medium", "high", "auto"]] = None, size: Optional[ Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] ] = None, @@ -13754,10 +13731,7 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + connectors `here `_. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -13824,10 +13798,7 @@ class MCPTool(Tool, discriminator="mcp"): # pylint: disable=docstring-keyword-s ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported - ``connector_id`` values are: + `_. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -13934,10 +13905,7 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service - connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported + connectors `here `_. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -14001,10 +13969,7 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): # pylint: disable=docst ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here - `_. This field - is deprecated for models released after September 1, 2026. Use ``server_url`` to connect to a - remote MCP server, or ``tunnel_id`` to connect through a Secure MCP Tunnel. Currently supported - ``connector_id`` values are: + `_. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -17336,9 +17301,8 @@ class RealtimeClientEventConversationItemCreate( """Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a "history" of the conversation and to add new items mid-stream, but has the current limitation that it cannot populate assistant - audio messages. If successful, the server will emit a ``conversation.item.added`` event and, - when the item is finalized, a ``conversation.item.done`` event. Otherwise, an ``error`` event - will be sent. + audio messages. If successful, the server will respond with a ``conversation.item.created`` + event, otherwise an ``error`` event will be sent. :ivar event_id: Optional client-generated ID used to identify this event. :vartype event_id: str @@ -17676,7 +17640,7 @@ class RealtimeClientEventOutputAudioBufferClear( to stop generating audio and emit a ``output_audio_buffer.cleared`` event. This event should be preceded by a ``response.cancel`` client event to stop the generation of the current response. `Learn more - `_. + `_. :ivar event_id: The unique ID of the client event used for error handling. :vartype event_id: str @@ -20323,7 +20287,7 @@ class RealtimeServerEventOutputAudioBufferCleared( VAD mode when the user has interrupted (``input_audio_buffer.speech_started``), or when the client has emitted the ``output_audio_buffer.clear`` event to manually cut off the current audio response. `Learn more - `_. + `_. :ivar event_id: The unique ID of the server event. Required. :vartype event_id: str @@ -25433,12 +25397,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TextResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An object specifying the format that the model must output. Configuring ``{ "type": "json_schema" }`` enables Structured Outputs, which ensures the model will match your supplied - JSON schema. Learn more in the `Structured Outputs guide - `_. The default format is ``{ - "type": "text" }`` with no additional options. *Not recommended for gpt-4o and newer models:** - Setting to ``{ "type": "json_object" }`` enables the older JSON mode, which ensures the message - the model generates is valid JSON. Using ``json_schema`` is preferred for models that support - it. + JSON schema. Learn more in the `Structured Outputs guide `_. + The default format is ``{ "type": "text" }`` with no additional options. *Not recommended for + gpt-4o and newer models:** Setting to ``{ "type": "json_object" }`` enables the older JSON + mode, which ensures the message the model generates is valid JSON. Using ``json_schema`` is + preferred for models that support it. You probably want to use the sub-classes and not this class directly. Known sub-classes are: TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText @@ -29330,11 +29293,10 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword ``gpt-transcribe`` and ``gpt-live-transcribe``. :vartype keywords: list[str] :ivar prompt: An optional text to guide the model's style or continue a previous audio segment. - For ``whisper-1``, the `prompt is a list of keywords - `_. For - ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free - text string, for example "expect words related to technology". Prompt is not supported with - ``gpt-realtime-whisper`` in GA Realtime sessions. + For ``whisper-1``, the `prompt is a list of keywords `_. + For ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a + free text string, for example "expect words related to technology". Prompt is not supported + with ``gpt-realtime-whisper`` in GA Realtime sessions. :vartype prompt: str :ivar delay: Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with @@ -29379,8 +29341,7 @@ class VoiceAgentInputTranscription(_Model): # pylint: disable=docstring-keyword ``gpt-live-transcribe``.""" prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An optional text to guide the model's style or continue a previous audio segment. For - ``whisper-1``, the `prompt is a list of keywords - `_. For + ``whisper-1``, the `prompt is a list of keywords `_. For ``gpt-4o-transcribe`` models (excluding ``gpt-4o-transcribe-diarize``), the prompt is a free text string, for example \"expect words related to technology\". Prompt is not supported with ``gpt-realtime-whisper`` in GA Realtime sessions.""" From 49bfbd6fdb47d863ff5c6abbb979c6ea22f30767 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 29 Oct 2026 16:40:02 -0700 Subject: [PATCH 19/20] Fix tests for regenerated agent tool model names Update existing sync and async tool and telemetry test consumers to the emitted Tool-prefixed models, including ToolMcpTool where a Tool subtype is required. Preserve assertions, request payloads, recordings and test enablement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../telemetry/test_responses_instrumentor.py | 18 +++++++------- .../test_responses_instrumentor_async.py | 10 ++++---- ...responses_instrumentor_code_interpreter.py | 10 ++++---- ...ses_instrumentor_code_interpreter_async.py | 10 ++++---- ...test_responses_instrumentor_file_search.py | 10 ++++---- ...esponses_instrumentor_file_search_async.py | 10 ++++---- .../test_responses_instrumentor_mcp.py | 10 ++++---- .../test_responses_instrumentor_mcp_async.py | 10 ++++---- ...est_agent_code_interpreter_and_function.py | 12 +++++----- ..._agent_file_search_and_code_interpreter.py | 12 +++++----- .../test_agent_file_search_and_function.py | 18 +++++++------- ...t_file_search_code_interpreter_function.py | 12 +++++----- .../test_multitool_with_conversations.py | 8 +++---- .../tools/test_agent_code_interpreter.py | 6 ++--- .../test_agent_code_interpreter_async.py | 4 ++-- .../agents/tools/test_agent_file_search.py | 10 ++++---- .../tools/test_agent_file_search_async.py | 6 ++--- .../tools/test_agent_file_search_stream.py | 8 +++---- .../test_agent_file_search_stream_async.py | 4 ++-- .../agents/tools/test_agent_function_tool.py | 10 ++++---- .../tools/test_agent_function_tool_async.py | 10 ++++---- .../tools/test_agent_image_generation.py | 8 +++---- .../test_agent_image_generation_async.py | 4 ++-- .../tests/agents/tools/test_agent_mcp.py | 6 ++--- .../agents/tools/test_agent_mcp_async.py | 4 ++-- .../test_agent_tools_with_conversations.py | 24 ++++++++++--------- .../agents/tools/test_agent_web_search.py | 8 +++---- .../tools/test_agent_web_search_async.py | 4 ++-- 28 files changed, 134 insertions(+), 132 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py index 6d3d92dda257..8d274de65782 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py @@ -26,7 +26,7 @@ _set_use_simple_tool_format, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -981,7 +981,7 @@ def _test_sync_function_tool_with_content_recording_non_streaming_impl( # pylin deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -1240,7 +1240,7 @@ def _test_sync_function_tool_with_content_recording_streaming_impl( # pylint: d deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -1564,7 +1564,7 @@ def _test_sync_function_tool_without_content_recording_non_streaming_impl( # py deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -1800,7 +1800,7 @@ def _test_sync_function_tool_without_content_recording_streaming_impl( # pylint deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -2118,7 +2118,7 @@ def test_sync_function_tool_list_conversation_items_with_content_recording(self, deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -2268,7 +2268,7 @@ def test_sync_function_tool_list_conversation_items_without_content_recording(se deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -4700,7 +4700,7 @@ def test_responses_stream_method_with_tools_with_content_recording(self, **kwarg deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -4818,7 +4818,7 @@ def test_responses_stream_method_with_tools_without_content_recording(self, **kw deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py index 9dbcf1bb2531..882745a6164c 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py @@ -25,7 +25,7 @@ _set_use_simple_tool_format, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import FunctionTool, PromptAgentDefinition +from azure.ai.projects.models import ToolFunctionTool, PromptAgentDefinition from azure.core.settings import settings BINARY_DATA_TRACING_ENV_VARIABLE = "AZURE_TRACING_GEN_AI_INCLUDE_BINARY_DATA" @@ -419,7 +419,7 @@ async def _test_async_function_tool_with_content_recording_streaming_impl( # py deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -680,7 +680,7 @@ async def _test_async_function_tool_without_content_recording_streaming_impl( # deployment_name = kwargs.get("foundry_model_name") # Define a function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", parameters={ "type": "object", @@ -2752,7 +2752,7 @@ async def _test_async_responses_stream_method_with_tools_with_content_recording_ deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -3001,7 +3001,7 @@ async def _test_async_responses_stream_method_with_tools_without_content_recordi deployment_name = kwargs.get("foundry_model_name") # Define a function tool - function_tool = FunctionTool( + function_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py index 89d8a16d881c..a44876eb0478 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py @@ -26,7 +26,7 @@ ) from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) from azure.core.settings import settings @@ -96,7 +96,7 @@ def test_sync_code_interpreter_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -285,7 +285,7 @@ def test_sync_code_interpreter_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -478,7 +478,7 @@ def test_sync_code_interpreter_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -671,7 +671,7 @@ def test_sync_code_interpreter_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py index 8cd4a00868e3..07401d2905ce 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py @@ -27,7 +27,7 @@ ) from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) from azure.core.settings import settings @@ -96,7 +96,7 @@ async def test_async_code_interpreter_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -285,7 +285,7 @@ async def test_async_code_interpreter_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -478,7 +478,7 @@ async def test_async_code_interpreter_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) @@ -671,7 +671,7 @@ async def test_async_code_interpreter_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can execute Python code to analyze data.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py index fc9129e74489..74a6ec963a8d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py @@ -24,7 +24,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -97,7 +97,7 @@ def test_sync_file_search_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -308,7 +308,7 @@ def test_sync_file_search_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -517,7 +517,7 @@ def test_sync_file_search_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -724,7 +724,7 @@ def test_sync_file_search_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py index afe7445ed887..8ab44a824b04 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py @@ -25,7 +25,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -98,7 +98,7 @@ async def test_async_file_search_non_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -309,7 +309,7 @@ async def test_async_file_search_non_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -518,7 +518,7 @@ async def test_async_file_search_streaming_with_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) @@ -725,7 +725,7 @@ async def test_async_file_search_streaming_without_content_recording( definition=PromptAgentDefinition( model=deployment_name, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py index 37e706349336..a755b9995c67 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py @@ -24,7 +24,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -69,7 +69,7 @@ def _test_sync_mcp_non_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -401,7 +401,7 @@ def _test_sync_mcp_non_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -720,7 +720,7 @@ def _test_sync_mcp_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -998,7 +998,7 @@ def _test_sync_mcp_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py index 2d1d410500c4..188d2b72802f 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py @@ -25,7 +25,7 @@ _set_use_message_events, RESPONSES_PROVIDER, ) -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool from azure.core.settings import settings settings.tracing_implementation = "OpenTelemetry" @@ -70,7 +70,7 @@ async def _test_async_mcp_non_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -401,7 +401,7 @@ async def _test_async_mcp_non_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -722,7 +722,7 @@ async def _test_async_mcp_streaming_with_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -1003,7 +1003,7 @@ async def _test_async_mcp_streaming_without_content_recording_impl( openai_client = project_client.get_openai_client() # Create MCP tool - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py index 4facf6eab766..46de6c857a5a 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py @@ -16,9 +16,9 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, - FunctionTool, + ToolFunctionTool, ) @@ -43,7 +43,7 @@ def test_calculate_and_save(self, **kwargs): openai_client = project_client.get_openai_client() # Define function tool - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="save_result", description="Save the calculation result. Must be called to persist the result.", parameters={ @@ -65,7 +65,7 @@ def test_calculate_and_save(self, **kwargs): model=model, instructions="You are a calculator assistant. Use code interpreter to perform calculations, then ALWAYS save the result using the save_result function.", tools=[ - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), func_tool, ], ), @@ -103,7 +103,7 @@ def test_generate_data_and_report(self, **kwargs): openai_client = project_client.get_openai_client() # Define function tool - report_function = FunctionTool( + report_function = ToolFunctionTool( name="generate_report", description="Generate and save a report with the analysis results. Must be called to create the report.", parameters={ @@ -127,7 +127,7 @@ def test_generate_data_and_report(self, **kwargs): model=model, instructions="You are a data analyst. Use code interpreter to generate and analyze data, then ALWAYS create a report using the generate_report function with the exact statistics you computed.", tools=[ - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), report_function, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py index a9c7774dd6d2..ca5dc93a7448 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py @@ -17,8 +17,8 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - FileSearchTool, - CodeInterpreterTool, + ToolFileSearchTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) @@ -87,8 +87,8 @@ def test_find_and_analyze_data(self, **kwargs): model=model, instructions="You are a data analyst. Use file search to find data files, then use code interpreter to perform calculations on the data.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), ], ), description="Agent with File Search and Code Interpreter.", @@ -157,8 +157,8 @@ def fibonacci(n): model=model, instructions="You are a code analyst. Use file search to find code files, then use code interpreter to execute and test the code.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), ], ), description="Agent for code analysis and execution.", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py index a72abe80a436..3037816516ef 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py @@ -17,7 +17,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool, ToolFunctionTool class TestAgentFileSearchAndFunction(TestBase): @@ -69,7 +69,7 @@ def test_data_analysis_workflow(self, **kwargs): assert file.status == "completed" # Define function tool - save_results_function = FunctionTool( + save_results_function = ToolFunctionTool( name="save_analysis_results", description="Save the analysis results", parameters={ @@ -93,7 +93,7 @@ def test_data_analysis_workflow(self, **kwargs): model=model, instructions="You are a data analyst. Use file search to find data and save_analysis_results function to save your findings.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_results_function, ], ), @@ -172,7 +172,7 @@ def test_empty_vector_store_handling(self, **kwargs): print(f"Empty vector store created (id: {vector_store.id})") # Define function tool - error_function = FunctionTool( + error_function = ToolFunctionTool( name="report_error", description="Report when data is not available", parameters={ @@ -196,7 +196,7 @@ def test_empty_vector_store_handling(self, **kwargs): model=model, instructions="Search for data. If you can't find it, use report_error function to explain what happened.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), error_function, ], ), @@ -270,7 +270,7 @@ def calculate_sum(numbers): print(f"Python file uploaded (id: {file.id})") # Define function tool - save_function = FunctionTool( + save_function = ToolFunctionTool( name="save_code_review", description="Save code review findings. Must be called to persist the review.", parameters={ @@ -294,7 +294,7 @@ def calculate_sum(numbers): model=model, instructions="You are a code reviewer. Search for code files, analyze them, and ALWAYS save your findings using the save_code_review function.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_function, ], ), @@ -419,7 +419,7 @@ def test_multi_turn_search_and_save_workflow(self, **kwargs): # pylint: disable print(f"Documents uploaded: {uploaded1.id}, {uploaded2.id}") # Define save function - save_finding = FunctionTool( + save_finding = ToolFunctionTool( name="save_finding", description="Save research finding", parameters={ @@ -441,7 +441,7 @@ def test_multi_turn_search_and_save_workflow(self, **kwargs): # pylint: disable model=model, instructions="You are a research assistant. Search documents and save important findings.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_finding, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py index 3599a865ea38..d106992c51c2 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py @@ -16,10 +16,10 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - FileSearchTool, - CodeInterpreterTool, + ToolFileSearchTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, - FunctionTool, + ToolFunctionTool, ) @@ -76,7 +76,7 @@ def test_complete_analysis_workflow(self, **kwargs): print(f"File uploaded (id: {file.id})") # Define function tool for saving analysis results - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="save_analysis", description="Save the statistical analysis results. Must be called to persist the analysis.", parameters={ @@ -100,8 +100,8 @@ def test_complete_analysis_workflow(self, **kwargs): model=model, instructions="You are a data analyst. Use file search to find data files, code interpreter to calculate statistics, and ALWAYS save your analysis using the save_analysis function.", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=AutoCodeInterpreterToolParam()), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam()), func_tool, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py index e197a2c1e148..68bcb70e0d99 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py @@ -15,8 +15,8 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( - FunctionTool, - FileSearchTool, + ToolFunctionTool, + ToolFileSearchTool, PromptAgentDefinition, ) @@ -60,7 +60,7 @@ def test_file_search_and_function_with_conversation(self, **kwargs): # pylint: print(f"Vector store created: {vector_store.id}") # Define save function - save_report = FunctionTool( + save_report = ToolFunctionTool( name="save_report", description="Save a report summary. Use this when explicitly asked to perform a save operation.", parameters={ @@ -82,7 +82,7 @@ def test_file_search_and_function_with_conversation(self, **kwargs): # pylint: model=model, instructions="You are an analyst. Search data to answer questions and save reports when instructed", tools=[ - FileSearchTool(vector_store_ids=[vector_store.id]), + ToolFileSearchTool(vector_store_ids=[vector_store.id]), save_report, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py index 94e7d041b349..6e17b74de238 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py @@ -11,7 +11,7 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) @@ -54,7 +54,7 @@ def test_agent_code_interpreter_simple_math(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can execute Python code.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], ), description="Simple code interpreter agent for basic Python execution.", ) @@ -154,7 +154,7 @@ def test_agent_code_interpreter_file_generation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can analyze data and create visualizations.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), description="Code interpreter agent for file processing and chart generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py index d40a1eb2524a..07ee6576440e 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py @@ -10,7 +10,7 @@ from devtools_testutils import RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - CodeInterpreterTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, ) @@ -40,7 +40,7 @@ async def test_agent_code_interpreter_simple_math_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can execute Python code.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], ), description="Simple code interpreter agent for basic Python execution.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py index 12ca1e54f204..fb3e060fc5df 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py @@ -10,7 +10,7 @@ import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearch(TestBase): @@ -25,7 +25,7 @@ def test_agent_file_search(self, **kwargs): This test verifies that an agent can: 1. Upload and index documents into a vector store - 2. Use FileSearchTool to search through uploaded documents + 2. Use ToolFileSearchTool to search through uploaded documents 3. Answer questions based on document content Routes used in this test: @@ -38,7 +38,7 @@ def test_agent_file_search(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (with FileSearchTool) + POST /openai/responses openai_client.responses.create() (with ToolFileSearchTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -82,7 +82,7 @@ def test_agent_file_search(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search capabilities.", ) @@ -250,7 +250,7 @@ def test_agent_file_search_multi_turn_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a product information assistant. Use file search to answer questions about products.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for multi-turn product queries.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py index 77179e0d4067..b1e1ad0c2d13 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py @@ -10,7 +10,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearchAsync(TestBase): @@ -56,7 +56,7 @@ async def test_agent_file_search_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search capabilities.", ) @@ -152,7 +152,7 @@ async def test_agent_file_search_multi_turn_conversation_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a product information assistant. Use file search to answer questions about products.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for multi-turn product queries.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py index 1202e2b66ae5..7792eaee8f7d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py @@ -8,7 +8,7 @@ import os from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearchStream(TestBase): @@ -21,7 +21,7 @@ def test_agent_file_search_stream(self, **kwargs): This test verifies that an agent can: 1. Upload and index documents into a vector store - 2. Use FileSearchTool with streaming enabled + 2. Use ToolFileSearchTool with streaming enabled 3. Stream back responses based on document content Routes used in this test: @@ -34,7 +34,7 @@ def test_agent_file_search_stream(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (stream=True, with FileSearchTool) + POST /openai/responses openai_client.responses.create() (stream=True, with ToolFileSearchTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -78,7 +78,7 @@ def test_agent_file_search_stream(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search with streaming.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py index e68be74712c7..b5a80cdceb6b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py @@ -9,7 +9,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool class TestAgentFileSearchStreamAsync(TestBase): @@ -55,7 +55,7 @@ async def test_agent_file_search_stream_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can search through uploaded documents to answer questions.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Agent for testing file search with streaming.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py index 640c21193371..bd01dfa9266c 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py @@ -9,7 +9,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool class TestAgentFunctionTool(TestBase): @@ -48,7 +48,7 @@ def test_agent_function_tool(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Define a function tool for the model to use - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -178,7 +178,7 @@ def test_agent_function_tool_multi_turn_with_multiple_calls(self, **kwargs): # project_client.get_openai_client() as openai_client, ): # Define multiple function tools - get_weather = FunctionTool( + get_weather = ToolFunctionTool( name="get_weather", description="Get current weather for a city", parameters={ @@ -195,7 +195,7 @@ def test_agent_function_tool_multi_turn_with_multiple_calls(self, **kwargs): # strict=True, ) - get_temperature_forecast = FunctionTool( + get_temperature_forecast = ToolFunctionTool( name="get_temperature_forecast", description="Get 3-day temperature forecast for a city", parameters={ @@ -387,7 +387,7 @@ def test_agent_function_tool_context_dependent_followup(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Define function tool - get_temperature = FunctionTool( + get_temperature = ToolFunctionTool( name="get_temperature", description="Get current temperature for a city in Fahrenheit", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py index d5086b4fc3a9..245bb9c134dc 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py @@ -10,7 +10,7 @@ from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool class TestAgentFunctionToolAsync(TestBase): @@ -36,7 +36,7 @@ async def test_agent_function_tool_async(self, **kwargs): async with project_client: # Define a function tool for the model to use - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_weather", description="Get the current weather for a location.", parameters={ @@ -169,7 +169,7 @@ async def test_agent_function_tool_multi_turn_with_multiple_calls_async( async with project_client: # Define multiple function tools - get_weather = FunctionTool( + get_weather = ToolFunctionTool( name="get_weather", description="Get current weather for a city", parameters={ @@ -186,7 +186,7 @@ async def test_agent_function_tool_multi_turn_with_multiple_calls_async( strict=True, ) - get_temperature_forecast = FunctionTool( + get_temperature_forecast = ToolFunctionTool( name="get_temperature_forecast", description="Get 3-day temperature forecast for a city", parameters={ @@ -379,7 +379,7 @@ async def test_agent_function_tool_context_dependent_followup_async(self, **kwar project_client.get_openai_client() as openai_client, ): # Define function tool - get_temperature = FunctionTool( + get_temperature = ToolFunctionTool( name="get_temperature", description="Get current temperature for a city in Fahrenheit", parameters={ diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py index f7e9bc4a3ab6..427a35e86fec 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py @@ -10,7 +10,7 @@ import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool from azure.core.exceptions import ResourceNotFoundError @@ -23,7 +23,7 @@ def test_agent_image_generation(self, **kwargs): Test agent with Image Generation tool. This test verifies that an agent can: - 1. Use ImageGenTool to generate images from text prompts + 1. Use ToolImageGenTool to generate images from text prompts 2. Return base64-encoded image data 3. Decode and validate the image format @@ -35,7 +35,7 @@ def test_agent_image_generation(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (with ImageGenTool) + POST /openai/responses openai_client.responses.create() (with ToolImageGenTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -67,7 +67,7 @@ def test_agent_image_generation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="Generate images based on user prompts", - tools=[ImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore + tools=[ToolImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore ), description="Agent for testing image generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py index a40a1e526a85..0a22aae1fa72 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py @@ -11,7 +11,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool from azure.core.exceptions import ResourceNotFoundError @@ -47,7 +47,7 @@ async def test_agent_image_generation_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="Generate images based on user prompts", - tools=[ImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore + tools=[ToolImageGenTool(model=image_model, quality="low", size="1024x1024")], # type: ignore ), description="Agent for testing image generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py index 69afe5032a90..6bc4c40fd159 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py @@ -10,7 +10,7 @@ from devtools_testutils import is_live_and_not_recording from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import McpApprovalResponse, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool class TestAgentMCP(TestBase): @@ -55,7 +55,7 @@ def test_agent_mcp_basic(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Create MCP tool that connects to a public GitHub repo via MCP server - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", @@ -195,7 +195,7 @@ def test_agent_mcp_with_project_connection(self, **kwargs): print(f"Using MCP project connection: {mcp_project_connection_id}") # Create MCP tool with project connection for GitHub API access - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="github-api", server_url="https://api.githubcopilot.com/mcp", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py index 54145ba2b049..de13c2eb2094 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py @@ -9,7 +9,7 @@ from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport from openai.types.responses.response_input_param import McpApprovalResponse, ResponseInputParam -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool class TestAgentMCPAsync(TestBase): @@ -27,7 +27,7 @@ async def test_agent_mcp_basic_async(self, **kwargs): project_client.get_openai_client() as openai_client, ): # Create MCP tool that connects to a public GitHub repo via MCP server - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py index 60f429023f2f..54ed30949e52 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py @@ -16,9 +16,9 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam from azure.ai.projects.models import ( - FunctionTool, - FileSearchTool, - CodeInterpreterTool, + ToolFunctionTool, + ToolFileSearchTool, + ToolCodeInterpreterTool, AutoCodeInterpreterToolParam, PromptAgentDefinition, ) @@ -30,7 +30,7 @@ class TestAgentToolsWithConversations(TestBase): @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_function_tool_with_conversation(self, **kwargs): # pylint: disable=too-many-statements """ - Test using FunctionTool within a conversation. + Test using ToolFunctionTool within a conversation. This tests: - Creating a conversation @@ -46,7 +46,7 @@ def test_function_tool_with_conversation(self, **kwargs): # pylint: disable=too project_client.get_openai_client() as openai_client, ): # Define a calculator function - calculator = FunctionTool( + calculator = ToolFunctionTool( name="calculator", description="Perform basic arithmetic operations", parameters={ @@ -192,7 +192,7 @@ def test_function_tool_with_conversation(self, **kwargs): # pylint: disable=too @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_file_search_with_conversation(self, **kwargs): """ - Test using FileSearchTool within a conversation. + Test using ToolFileSearchTool within a conversation. This tests: - Server-side tool execution within conversation @@ -249,7 +249,7 @@ def test_file_search_with_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a product search assistant. Answer questions about products.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="Search agent for conversation testing.", ) @@ -309,7 +309,7 @@ def test_file_search_with_conversation(self, **kwargs): @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_code_interpreter_with_conversation(self, **kwargs): """ - Test using CodeInterpreterTool within a conversation. + Test using ToolCodeInterpreterTool within a conversation. This tests: - Server-side code execution within conversation @@ -329,7 +329,7 @@ def test_code_interpreter_with_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a data analysis assistant. Use Python to perform calculations.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[]))], ), description="Code interpreter agent for conversation testing.", ) @@ -391,7 +391,7 @@ def test_code_interpreter_with_conversation(self, **kwargs): @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX2) def test_code_interpreter_with_file_in_conversation(self, **kwargs): """ - Test using CodeInterpreterTool with file upload within a conversation. + Test using ToolCodeInterpreterTool with file upload within a conversation. This test reproduces the 500 error seen in the sample when using code interpreter with uploaded files in conversations. @@ -428,7 +428,9 @@ def test_code_interpreter_with_file_in_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[uploaded_file.id]))], + tools=[ + ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[uploaded_file.id])) + ], ), description="Code interpreter agent for data analysis and visualization.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py index feebb047bb5d..411f1c027875 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py @@ -7,7 +7,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import PromptAgentDefinition, ToolWebSearchPreviewTool, ApproximateLocation class TestAgentWebSearch(TestBase): @@ -19,7 +19,7 @@ def test_agent_web_search(self, **kwargs): Test agent with Web Search tool for real-time information. This test verifies that an agent can: - 1. Use WebSearchPreviewTool to search the web + 1. Use ToolWebSearchPreviewTool to search the web 2. Get current/real-time information 3. Provide answers based on web search results @@ -31,7 +31,7 @@ def test_agent_web_search(self, **kwargs): POST /agents/{agent_name}/versions project_client.agents.create_version() # Test focus: - POST /openai/responses openai_client.responses.create() (with WebSearchPreviewTool) + POST /openai/responses openai_client.responses.create() (with ToolWebSearchPreviewTool) # Teardown: DELETE /agents/{agent_name}/versions/{agent_version} project_client.agents.delete_version() @@ -52,7 +52,7 @@ def test_agent_web_search(self, **kwargs): model=model, instructions="You are a helpful assistant that can search the web for current information.", tools=[ - WebSearchPreviewTool( + ToolWebSearchPreviewTool( user_location=ApproximateLocation(country="US", city="Seattle", region="Washington") ) ], diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py index d8930bd737e3..939a3b50f94b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py @@ -8,7 +8,7 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import PromptAgentDefinition, ToolWebSearchPreviewTool, ApproximateLocation class TestAgentWebSearchAsync(TestBase): @@ -32,7 +32,7 @@ async def test_agent_web_search_async(self, **kwargs): model=model, instructions="You are a helpful assistant that can search the web for current information.", tools=[ - WebSearchPreviewTool( + ToolWebSearchPreviewTool( user_location=ApproximateLocation(country="US", city="Seattle", region="Washington") ) ], From c2d88431c7d41e39efffd10a12054e8cb7c48be8 Mon Sep 17 00:00:00 2001 From: Xiting Zhang Date: Thu, 29 Oct 2026 17:39:23 -0700 Subject: [PATCH 20/20] Fix emitted SDK sample compatibility and spelling checks Update existing agent, tool, workflow, and evaluation samples to the generated Tool-prefixed models. Keep request payloads and sample behavior unchanged. Scope valid voice names and SDK terminology to azure-ai-projects in the spelling dictionary without editing generated SDK code or disabling checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .vscode/cspell.json | 22 +++++++++++++++++++ ..._workflow_multi_agent_with_mcp_approval.py | 4 ++-- .../tools/sample_agent_code_interpreter.py | 4 ++-- .../sample_agent_code_interpreter_async.py | 4 ++-- ...gent_code_interpreter_structured_inputs.py | 4 ++-- ...ample_agent_code_interpreter_with_files.py | 4 ++-- ...agent_code_interpreter_with_files_async.py | 4 ++-- .../agents/tools/sample_agent_computer_use.py | 4 ++-- .../tools/sample_agent_computer_use_async.py | 4 ++-- .../agents/tools/sample_agent_file_search.py | 4 ++-- .../sample_agent_file_search_in_stream.py | 4 ++-- ...ample_agent_file_search_in_stream_async.py | 4 ++-- ...ple_agent_file_search_structured_inputs.py | 4 ++-- .../tools/sample_agent_function_tool.py | 4 ++-- .../tools/sample_agent_function_tool_async.py | 4 ++-- .../tools/sample_agent_image_generation.py | 12 +++++----- .../sample_agent_image_generation_async.py | 12 +++++----- .../samples/agents/tools/sample_agent_mcp.py | 4 ++-- .../agents/tools/sample_agent_mcp_async.py | 4 ++-- ...ample_agent_mcp_with_project_connection.py | 4 ++-- ...agent_mcp_with_project_connection_async.py | 4 ++-- .../agents/tools/sample_agent_web_search.py | 4 ++-- .../tools/sample_agent_web_search_preview.py | 4 ++-- ...ple_agent_web_search_with_custom_search.py | 4 ++-- .../agents/tools/sample_toolbox_with_shell.py | 6 ++--- .../sample_toolbox_with_shell_and_skill.py | 6 ++--- .../sample_toolbox_with_shipping_skill.py | 4 ++-- .../tools/sample_toolboxes_with_search.py | 6 ++--- .../sample_toolboxes_with_search_async.py | 6 ++--- ..._response_evaluation_with_function_tool.py | 4 ++-- 30 files changed, 92 insertions(+), 70 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index f4b5aaf98763..3111d4b33ef2 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -2178,6 +2178,28 @@ "Hundredkm" ] }, + { + "filename": "sdk/ai/azure-ai-projects/**", + "words": [ + "azcopy", + "brise", + "csdl", + "dedup", + "flitz", + "genai", + "harema", + "inpainting", + "juni", + "nira", + "noeul", + "nuri", + "shida", + "simpleqna", + "upia", + "webrtc", + "xhigh" + ] + }, { "filename": "sdk/ai/azure-ai-voicelive/**", "words": ["viseme","VISEME","ulaw","ULAW","logprobs","pyaudio","PyAudio","libasound","webrtc","WEBRTC"] diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py index 2ef0109250c5..028246d33be3 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_workflow_multi_agent_with_mcp_approval.py @@ -36,7 +36,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, WorkflowAgentDefinition, - MCPTool, + ToolMcpTool, ) load_dotenv() @@ -50,7 +50,7 @@ ): # Define MCP tool for accessing external resources (optional - can be removed for simpler demo) # Note: MCP tools in workflows may require special handling depending on the use case - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py index 3703d2a8a8e7..12d26efa780c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py @@ -29,7 +29,7 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool load_dotenv() @@ -45,7 +45,7 @@ definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool()], + tools=[ToolCodeInterpreterTool()], ), description="Code interpreter agent for data analysis and visualization.", ), diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py index 7b002282df3b..3841be54e052 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py @@ -30,7 +30,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool load_dotenv() @@ -48,7 +48,7 @@ async def main() -> None: definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool()], + tools=[ToolCodeInterpreterTool()], ), description="Code interpreter agent for data analysis and visualization.", ), diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py index f631ca4ed14b..38222f0aea75 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_structured_inputs.py @@ -39,7 +39,7 @@ from azure.ai.projects.models._models import AutoCodeInterpreterToolParam from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, StructuredInputDefinition +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool, StructuredInputDefinition load_dotenv() @@ -58,7 +58,7 @@ uploaded = openai_client.files.create(purpose="assistants", file=csv_file) print(f"File uploaded (id: {uploaded.id})") - tool = CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=["{{analysis_file_id}}"])) + tool = ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=["{{analysis_file_id}}"])) agent_definition = PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py index c4891fc02731..5c555f08fc6b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files.py @@ -29,7 +29,7 @@ from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, AutoCodeInterpreterToolParam +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool, AutoCodeInterpreterToolParam load_dotenv() @@ -50,7 +50,7 @@ with open(asset_file_path, "rb") as f: file = openai_client.files.create(purpose="assistants", file=f) - tool = CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id])) + tool = ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id])) print(f"File uploaded (id: {file.id})") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py index 25d6173c5595..65130a0b0e87 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_with_files_async.py @@ -30,7 +30,7 @@ from dotenv import load_dotenv from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, AutoCodeInterpreterToolParam +from azure.ai.projects.models import PromptAgentDefinition, ToolCodeInterpreterTool, AutoCodeInterpreterToolParam load_dotenv() @@ -62,7 +62,7 @@ async def main() -> None: definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], + tools=[ToolCodeInterpreterTool(container=AutoCodeInterpreterToolParam(file_ids=[file.id]))], ), description="Code interpreter agent for data analysis and visualization.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py index 0f2a733df0dc..ead44b1bc5cc 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py @@ -43,7 +43,7 @@ ) from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ComputerUsePreviewTool +from azure.ai.projects.models import PromptAgentDefinition, ToolComputerUsePreviewTool load_dotenv() @@ -61,7 +61,7 @@ print("Failed to load required screenshot assets. Please ensure the asset files exist in ../assets/") exit(1) # pylint: disable=consider-using-sys-exit -tool = ComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") +tool = ToolComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") with ( DefaultAzureCredential() as credential, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py index 79960c8162c2..5aa52e1430ef 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py @@ -43,7 +43,7 @@ ) from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ComputerUsePreviewTool +from azure.ai.projects.models import PromptAgentDefinition, ToolComputerUsePreviewTool load_dotenv() @@ -64,7 +64,7 @@ async def main(): print("Failed to load required screenshot assets. Please ensure the asset files exist in ../assets/") return - computer_use_tool = ComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") + computer_use_tool = ToolComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows") async with ( DefaultAzureCredential() as credential, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py index fc6e7da22dd8..6b1a29b5cc99 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py @@ -29,7 +29,7 @@ # Azure AI imports from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool load_dotenv() @@ -52,7 +52,7 @@ file = openai_client.vector_stores.files.upload_and_poll(vector_store_id=vector_store.id, file=f) print(f"File uploaded to vector store (id: {file.id})") - tool = FileSearchTool(vector_store_ids=[vector_store.id]) + tool = ToolFileSearchTool(vector_store_ids=[vector_store.id]) # Create agent with file search tool agent = project_client.agents.create_version( diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py index 49501c4a05b7..0ad7b15bcd1b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py @@ -28,7 +28,7 @@ from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool load_dotenv() @@ -63,7 +63,7 @@ definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant that can search through product information and provide detailed responses. Use the file search tool to find relevant information before answering.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="File search agent with streaming response capabilities.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py index 889d8a6b24b8..c63bc9946aee 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py @@ -29,7 +29,7 @@ from dotenv import load_dotenv from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool load_dotenv() @@ -64,7 +64,7 @@ async def main() -> None: # pylint: disable=too-many-statements definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="You are a helpful assistant that can search through product information and provide detailed responses. Use the file search tool to find relevant information before answering.", - tools=[FileSearchTool(vector_store_ids=[vector_store.id])], + tools=[ToolFileSearchTool(vector_store_ids=[vector_store.id])], ), description="File search agent with streaming response capabilities.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py index 6e24325aa01f..8e20931b7085 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_structured_inputs.py @@ -35,7 +35,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool, StructuredInputDefinition +from azure.ai.projects.models import PromptAgentDefinition, ToolFileSearchTool, StructuredInputDefinition load_dotenv() @@ -59,7 +59,7 @@ print(f"File uploaded to vector store (id: {file.id})") # Tool resources are templated and resolved at runtime via structured inputs. - tool = FileSearchTool(vector_store_ids=["{{vector_store_id}}"]) + tool = ToolFileSearchTool(vector_store_ids=["{{vector_store_id}}"]) agent_definition = PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py index e6e9a9d417bf..e3de30967ec4 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py @@ -32,7 +32,7 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool load_dotenv() @@ -47,7 +47,7 @@ def get_horoscope(sign: str) -> str: endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] -tool = FunctionTool( +tool = ToolFunctionTool( name="get_horoscope", parameters={ "type": "object", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py index 9756f2a32841..2da388c65fbf 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py @@ -34,7 +34,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, FunctionTool +from azure.ai.projects.models import PromptAgentDefinition, ToolFunctionTool load_dotenv() @@ -49,7 +49,7 @@ async def get_horoscope(sign: str) -> str: async def main(): # Define a function tool for the model to use - func_tool = FunctionTool( + func_tool = ToolFunctionTool( name="get_horoscope", parameters={ "type": "object", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py index 7dbf7ff139c4..468197d240ca 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py @@ -7,11 +7,11 @@ """ DESCRIPTION: This sample demonstrates how to create an AI Agent with image generation capabilities - using the ImageGenTool and synchronous Azure AI Projects client. The Agent can generate + using the ToolImageGenTool and synchronous Azure AI Projects client. The Agent can generate images based on text prompts and save them to files. The sample shows: - - Creating an Agent with ImageGenTool configured for image generation + - Creating an Agent with ToolImageGenTool configured for image generation - Making requests to generate images from text prompts - Extracting base64-encoded image data from the response - Decoding and saving the generated image to a local file @@ -34,11 +34,11 @@ used by the Agent for understanding and responding to prompts. This is NOT the image generation model. 3) FOUNDRY_AGENT_NAME - Optional. The name of the AI agent. If not set, defaults to "MyAgent". 4) IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME - The deployment name of the image generation model (e.g. gpt-image-1) - used by the ImageGenTool. + used by the ToolImageGenTool. NOTE: - Image generation requires a separate (e.g. gpt-image-1) deployment which is specified when constructing - the `ImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when + the `ToolImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when calling `.responses.create`. - The generated image will be saved as "happy-dogs.png" in the OS temporary directory. """ @@ -52,7 +52,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool load_dotenv() @@ -60,7 +60,7 @@ agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" image_generation_model = os.environ["IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME"] -tool = ImageGenTool( +tool = ToolImageGenTool( model=image_generation_model, # Model such as "gpt-image-1" quality="low", size="1024x1024", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py index 5a7a034cf02f..a0d01e97ffb2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py @@ -7,11 +7,11 @@ """ DESCRIPTION: This sample demonstrates how to create an AI Agent with image generation capabilities - using the ImageGenTool and asynchronous Azure AI Projects client. The Agent can generate + using the ToolImageGenTool and asynchronous Azure AI Projects client. The Agent can generate images based on text prompts and save them to files. The sample shows: - - Creating an Agent with ImageGenTool configured for image generation + - Creating an Agent with ToolImageGenTool configured for image generation - Making requests to generate images from text prompts - Extracting base64-encoded image data from the response - Decoding and saving the generated image to a local file @@ -34,11 +34,11 @@ used by the Agent for understanding and responding to prompts. This is NOT the image generation model. 3) FOUNDRY_AGENT_NAME - Optional. The name of the AI agent. If not set, defaults to "MyAgent". 4) IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME - The deployment name of the image generation model (e.g. gpt-image-1) - used by the ImageGenTool. + used by the ToolImageGenTool. NOTE: - Image generation requires a separate (e.g. gpt-image-1) deployment which is specified when constructing - the `ImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when + the `ToolImageGenTool`, as well as providing it in the `x-ms-oai-image-generation-deployment` header when calling `.responses.create`. - The generated image will be saved as "happy-dogs.png" in the OS temporary directory. """ @@ -53,7 +53,7 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, ImageGenTool +from azure.ai.projects.models import PromptAgentDefinition, ToolImageGenTool load_dotenv() endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] @@ -71,7 +71,7 @@ async def main(): definition=PromptAgentDefinition( model=os.environ["FOUNDRY_MODEL_NAME"], instructions="Generate images based on user prompts", - tools=[ImageGenTool(model=image_generation_model, quality="low", size="1024x1024")], + tools=[ToolImageGenTool(model=image_generation_model, quality="low", size="1024x1024")], ), description="Agent for image generation.", ), diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py index 47844b570f30..923af7acbdd5 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py @@ -30,14 +30,14 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool load_dotenv() endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -mcp_tool = MCPTool( +mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py index a3f12af3b7cd..7194daaf2151 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py @@ -31,7 +31,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool load_dotenv() @@ -40,7 +40,7 @@ async def main(): - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://gitmcp.io/Azure/azure-rest-api-specs", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py index 5af6fb5756b6..00f4bdf0b039 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py @@ -32,7 +32,7 @@ from util import create_version_with_endpoint from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool load_dotenv() @@ -40,7 +40,7 @@ agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = MCPTool( +tool = ToolMcpTool( server_label="api-specs", server_url="https://api.githubcopilot.com/mcp", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py index d9dbcd020214..da20edbacd47 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py @@ -33,7 +33,7 @@ from util import create_version_with_endpoint_async from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, MCPTool, Tool +from azure.ai.projects.models import PromptAgentDefinition, ToolMcpTool, Tool load_dotenv() @@ -42,7 +42,7 @@ async def main(): - mcp_tool = MCPTool( + mcp_tool = ToolMcpTool( server_label="api-specs", server_url="https://api.githubcopilot.com/mcp", require_approval="always", diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py index 595fa2bf2dad..34d441a9949c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py @@ -41,7 +41,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - WebSearchTool, + ToolWebSearchTool, WebSearchApproximateLocation, ) @@ -51,7 +51,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = WebSearchTool(user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")) +tool = ToolWebSearchTool(user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")) with ( DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential) as project_client, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py index 819847e6379e..a099b67f89f2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py @@ -39,7 +39,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import PromptAgentDefinition, ToolWebSearchPreviewTool, ApproximateLocation load_dotenv() @@ -47,7 +47,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) +tool = ToolWebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) with ( DefaultAzureCredential() as credential, AIProjectClient(endpoint=endpoint, credential=credential) as project_client, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py index 48a94b24d6fc..d0917cfa4d26 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py @@ -46,7 +46,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - WebSearchTool, + ToolWebSearchTool, WebSearchConfiguration, ) @@ -56,7 +56,7 @@ endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] agent_name = os.environ.get("FOUNDRY_AGENT_NAME") or "MyAgent" -tool = WebSearchTool( +tool = ToolWebSearchTool( custom_search_configuration=WebSearchConfiguration( project_connection_id=os.environ["BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID"], instance_name=os.environ["BING_CUSTOM_SEARCH_INSTANCE_NAME"], diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py index 5f4b176caaa8..a83d7872e0f6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell.py @@ -11,7 +11,7 @@ report the Python version and working-directory contents of the shell tool's auto-provisioned, network-isolated container. - The agent reaches the toolbox through an `MCPTool` pointed at the toolbox's + The agent reaches the toolbox through a `ToolMcpTool` pointed at the toolbox's versioned `/mcp` URL, the same way any other toolbox tool is consumed. The sample prints the tools exposed by the MCP server, each shell command's arguments and output, and the agent's final response. @@ -38,7 +38,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, PromptAgentDefinition, ShellToolboxTool, ToolboxShellContainerAutoEnvironment, @@ -80,7 +80,7 @@ toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = credential.get_token("https://ai.azure.com/.default").token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py index 3501e98e24ba..2c865072bc2d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shell_and_skill.py @@ -12,7 +12,7 @@ working-directory contents of its auto-provisioned, network-isolated container. The sample downloads the persisted Skill's `SKILL.md` into the Prompt Agent - instructions. The agent reaches the shell through an `MCPTool` pointed at + instructions. The agent reaches the shell through a `ToolMcpTool` pointed at the Toolbox's versioned `/mcp` URL. The sample prints the tools exposed by the MCP server, each shell command's arguments and output, and the agent's final response. @@ -41,7 +41,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, PromptAgentDefinition, ShellToolboxTool, SkillInlineContent, @@ -116,7 +116,7 @@ toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = credential.get_token("https://ai.azure.com/.default").token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py index 25f14a49518b..90ea8123ead6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolbox_with_shipping_skill.py @@ -39,7 +39,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, PromptAgentDefinition, SkillInlineContent, ToolSearchToolboxTool, @@ -106,7 +106,7 @@ print(f"Created toolbox `{toolbox_version.name}` (version {toolbox_version.version}).") toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=credential.get_token("https://ai.azure.com/.default").token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py index 49afda0725b7..db8d7996e43e 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search.py @@ -12,7 +12,7 @@ A toolbox version that includes 'ToolSearchToolboxTool' exposes only two meta tools at its '/mcp' endpoint -- 'tool_search' and 'call_tool' - -- and defers every other tool behind them. The agent uses an 'MCPTool' + -- and defers every other tool behind them. The agent uses a 'ToolMcpTool' pointed at the toolbox's versioned '/mcp' URL to discover and invoke those inner tools. @@ -42,7 +42,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, MCPToolboxTool, ToolSearchToolboxTool, PromptAgentDefinition, @@ -82,7 +82,7 @@ toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = credential.get_token("https://ai.azure.com/.default").token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py index 575d0faf52b8..bba590e4cc91 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_toolboxes_with_search_async.py @@ -12,7 +12,7 @@ A toolbox version that includes 'ToolSearchToolboxTool' exposes only two meta tools at its '/mcp' endpoint -- 'tool_search' and 'call_tool' - -- and defers every other tool behind them. The agent uses an 'MCPTool' + -- and defers every other tool behind them. The agent uses a 'ToolMcpTool' pointed at the toolbox's versioned '/mcp' URL to discover and invoke those inner tools. @@ -43,7 +43,7 @@ from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - MCPTool, + ToolMcpTool, MCPToolboxTool, ToolSearchToolboxTool, PromptAgentDefinition, @@ -84,7 +84,7 @@ async def main() -> None: toolbox_mcp_url = f"{endpoint}/toolboxes/{TOOLBOX_NAME}/versions/{toolbox_version.version}/mcp?api-version=v1" token = (await credential.get_token("https://ai.azure.com/.default")).token - toolbox_mcp_tool = MCPTool( + toolbox_mcp_tool = ToolMcpTool( server_label=TOOLBOX_MCP_LABEL, server_url=toolbox_mcp_url, authorization=token, diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py index 6ae7d9c8048f..fd7b784c72c8 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py @@ -46,7 +46,7 @@ PromptAgentDefinition, ResponseRetrievalItemGenerationParams, Tool, - FunctionTool, + ToolFunctionTool, ) load_dotenv() @@ -55,7 +55,7 @@ model_deployment_name = os.environ["FOUNDRY_MODEL_NAME"] # Define a function tool for the model to use -func_tool = FunctionTool( +func_tool = ToolFunctionTool( name="get_horoscope", parameters={ "type": "object",